summaryrefslogtreecommitdiffstats
path: root/xlators
Commit message (Collapse)AuthorAgeFilesLines
* mount : fix high sev coverity issues in mount3.cSunny Kumar2018-10-161-1/+5
| | | | | | | | | This patch fixes CID 1395067, 1388767 and 1395068. updates: bz#789278 Change-Id: Ie92252281bf559dd29fab462e121445ff4d3b865 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cluster/dht: fixes to unlinking invalid linkto fileRaghavendra Gowdappa2018-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If unlinking of an invalid linkto file failed in lookup-everywhere codepath, lookup was failed with EIO. The rational as per the comment was, <snip> /* When dht_lookup_everywhere is performed, one cached *and one hashed file was found and hashed file does *not point to the above mentioned cached node. So it *was considered as stale and an unlink was performed. *But unlink fails. So may be rebalance is in progress. *now ideally we have two data-files. One obtained during *lookup_everywhere and one where unlink-failed. So *at this point in time we cannot decide which one to *choose because there are chances of first cached *file is truncated after rebalance and if it is chosen *as cached node, application will fail. So return EIO. */ </snip> However, this reasoning is only valid when * op_errno is EBUSY, indicating rebalance is in progress * op_errno is ENOTCONN as wecannot determine what was the status of file on brick. Hence this patch doesn't fail lookup unless unlink fails with an either EBUSY or ENOTCONN Change-Id: Ife55f3d97fe557f3db05beae0c2d786df31e8e55 Fixes: bz#1635145 Signed-off-by: Raghavendra Gowdappa <rgowdapp@redhat.com>
* features/shard: Hold a ref on base inode when adding a shard to lru listKrutika Dhananjay2018-10-161-14/+34
| | | | | | | | | | | | | | | | | | | | | | | | | In __shard_update_shards_inode_list(), previously shard translator was not holding a ref on the base inode whenever a shard was added to the lru list. But if the base shard is forgotten and destroyed either by fuse due to memory pressure or due to the file being deleted at some point by a different client with this client still containing stale shards in its lru list, the client would crash at the time of locking lru_base_inode->lock owing to illegal memory access. So now the base shard is ref'd into the inode ctx of every shard that is added to lru list until it gets lru'd out. The patch also handles the case where none of the shards associated with a file that is about to be deleted are part of the LRU list and where an unlink at the beginning of the operation destroys the base inode (because there are no refkeepers) and hence all of the shards that are about to be deleted will be resolved without the existence of a base shard in-memory. This, if not handled properly, could lead to a crash. Change-Id: Ic15ca41444dd04684a9458bd4a526b1d3e160499 updates: bz#1605056 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* libglusterfs/dict: Add sizeof()-1 variants of dict functionsPranith Kumar K2018-10-158-41/+23
| | | | | | | | | | | One needs to be very careful about giving same key for the key and SLEN(key) arguments in dict_xxxn() functions. Writing macros that would take care of passing the SLEN(key) would help reduce this burden on the developer and reviewer. updates: bz#1193929 Change-Id: I312c479b919826570b47ae2c219c53e2f9b2ddef Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* glusterd/geo-rep: Fix memory corruptionKotresh HR2018-10-121-2/+2
| | | | | | | | | | | | | | | | | | | | Problem and Analysis: The length of canonical format of uuid is 36 but 'GF_UUID_BUF_SIZE 50' was being used everywhere. glusterd/geo-rep code was earlier using strncpy, but recently changes to memcpy with the drive to avoid strncpys. This leads to memory corruption and glusterd is crashing without a core with geo-rep creation with ASAN build. Fix: 'GF_UUID_BUF_SIZE 37' (+ 1 for NULL byte) And change geo-rep to use UUID_CANONICAL_FORM_LEN instead Updates: bz#1633930 Change-Id: Ibd347d542b92e64a96ce06780cda643557233bc7 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* core: glusterfsd keeping fd open in index xlatorMohit Agrawal2018-10-122-12/+15
| | | | | | | | | | | | | | | | | | | | | | Problem: At the time of processing GF_EVENT_PARENT_DOWN at brick xlator, it forwards the event to next xlator only while xlator ensures no stub is in progress. At io-thread xlator it decreases stub_cnt before the process a stub and notify EVENT to next xlator Solution: Introduce a new counter to save stub_cnt and decrease the counter after process the stub completely at io-thread xlator. To avoid brick crash at the time of call xlator_mem_cleanup move only brick xlator if detach brick name has found in the graph Note: Thanks to pranith for sharing a simple reproducer to reproduce the same fixes bz#1637934 Change-Id: I1a694a001f7a5417e8771e3adf92c518969b6baa Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* features/locks: Fix Coverity issuesAshish Pandey2018-10-121-1/+4
| | | | | | | | | | | | | CID: 1395812 Explicit null dereferenced 1356542 Dereference null return value https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=86261835&defectInstanceId=26407100&mergedDefectId=1395812 https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=86261835&defectInstanceId=26407215&mergedDefectId=1356542 Change-Id: I2c20972a8080fa7a70b88eab0688b9cf734bbf24 updates: bz#789278 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* snapshot : fix high sev coverity on snapview-server.cSunny Kumar2018-10-121-0/+1
| | | | | | | | | This patch fixes CID 1325525 (double free). updates: bz#789278 Change-Id: I26a5f428dde83dd7708815f06830decf4068b94c Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* performance/nl-cache: clang fixIraj Jamali2018-10-121-1/+3
| | | | | | | | | | | Argument with 'nonnull' attribute passed null. Adding a check to avoid the issue. Updates: bz#1622665 Change-Id: I1d3a166e154a51da59bebb93a49f5174e593c98e Signed-off-by: Iraj Jamali <ijamali@redhat.com>
* mgmt/glusterd: clang fixIraj Jamali2018-10-121-3/+3
| | | | | | | | | | | Argument with 'nonnull' attribute passed null. Added checks to avoid the issues. Updates: bz#1622665 Change-Id: I0dba1185cee5baba3c124d687560a06fe182381e Signed-off-by: Iraj Jamali <ijamali@redhat.com>
* mgmt/glusterd: NULL pointer dereferencing clang fixShwetha Acharya2018-10-125-8/+8
| | | | | | | | | | | | | | | Problem: dereferencing of this->name; volinfo and xl can be null. Solution: Replaced this->name with apropriate names in few places, added a null check to avoid dereferencing of volinfo, and introduced a goto out statement, such that null pointer value is not passed to the function volgen_xlator_link when xl becomes NULL. Updates: bz#1622665 Change-Id: I77616bd23f58328cb6dbe681914a028991d49abb Signed-off-by: Shwetha Acharya <sacharya@redhat.com>
* performance/write-behind: NULL pointer passed to a nonnull parameterShwetha Acharya2018-10-111-0/+6
| | | | | | | | | | | | Problem: wb_directory_inode->lock can be null. Solution: added a condition, if(!wb_directory_inode->lock.spinlock) to address the issue (checked one of the attributes of union lock to ensure that union is not null). Updates: bz#1622665 Change-Id: I0749ee16aa2c23f51d4b4c7b0979d494bcd4d90e Signed-off-by: Shwetha Acharya <sacharya@redhat.com>
* cluster/dht : Fix coverity issueAshish Pandey2018-10-111-2/+2
| | | | | | | | | | | | To check if the gfid is null or not we should use function gf_uuid_is_null CID: 1382364 https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=86243257&defectInstanceId=26374360&mergedDefectId=1382364 Change-Id: I81944b823c9ee6e6dcc9695f64f7e5966e0d7030 updates: bz#789278 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* afr: prevent winding inodelks twice for arbiter volumesRavishankar N2018-10-101-1/+1
| | | | | | | | | | | | | | | | | | Problem: In an arbiter volume, if there is a pending data heal of a file only on arbiter brick, self-heal takes inodelks twice due to a code-bug but unlocks it only once, leaving behind a stale lock on the brick. This causes the next write to the file to hang. Fix: Fix the code-bug to take lock only once. This bug was introduced master with commit eb472d82a083883335bc494b87ea175ac43471ff Thanks to Pranith Kumar K <pkarampu@redhat.com> for finding the RCA. fixes: bz#1637802 Change-Id: I15ad969e10a6a3c4bd255e2948b6be6dcddc61e1 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* locks : fix coverity issueSunny Kumar2018-10-102-0/+8
| | | | | | | | | This patch fixes CID 1356544 and 1356539. Both are of type NULL_RETURNS. Change-Id: I2ef7c3ff9929c4d85b79fff00e835ebee3ff3ce0 updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* all: fix warnings on non 64-bits architecturesXavi Hernandez2018-10-1052-198/+218
| | | | | | | | | | When compiling in other architectures there appear many warnings. Some of them are actual problems that prevent gluster to work correctly on those architectures. Change-Id: Icdc7107a2bc2da662903c51910beddb84bdf03c0 fixes: bz#1632717 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* features/snapview-client: replace gf_log with gf_msgRaghavendra Bhat2018-10-104-168/+206
| | | | | | Change-Id: I87f01d86f50eb2fca21febb0ea3e77fbd152eb93 updates: bz#1626610 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
* cloudsync: coverity fixSusant Palai2018-10-102-2/+4
| | | | | | | | | CID: 1394649 1394657 Issue: Explicit null dereferenced Change-Id: Ic1040ffa5548e1ecd49cfdc9a8716be445cbdf0f Updates: bz#789278 Signed-off-by: Susant Palai <spalai@redhat.com>
* rpc: coverity fixesMilind Changire2018-10-091-0/+2
| | | | | | | | | | | | | CID: [1] 1394646 Unchecked return value from library CID: [2] 1394633 Unused value CID: 1382443 Sleeping while holding a lock [This is intentional] [1] https://scan6.coverity.com/reports.htm#v40014/p10714/fileInstanceId=86159112&defectInstanceId=26360786&mergedDefectId=1394646 [2] https://scan6.coverity.com/reports.htm#v40014/p10714/fileInstanceId=86159365&defectInstanceId=26360919&mergedDefectId=1394633 Change-Id: I03086f7a9672c9f50a2bc44cdbce0006c887357b updates: bz#789278 Signed-off-by: Milind Changire <mchangir@redhat.com>
* core: glusterfsd keeping fd open in index xlatorMohit Agrawal2018-10-0810-80/+329
| | | | | | | | | | | | | | Problem: Current resource cleanup sequence is not perfect while brick mux is enabled Solution: 1) Destroying xprt after cleanup all fd associated with a client 2) Before call fini for brick xlators ensure no stub should be running on a brick Change-Id: I86195785e428f57d3ef0da3e4061021fafacd435 fixes: bz#1631357 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* changetimerecorder : fix coverity issueSunny Kumar2018-10-081-0/+1
| | | | | | | | | | This patch fixes CID : 1124725 Issue : Resource leak updates: bz#789278 Change-Id: I2afe65875fa393fd2d2f90b6f7cf7f6782dabf89 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* features/bit-rot: NULL pointer deferencing clang fixSheetal Pamecha2018-10-082-5/+13
| | | | | | | | | | | Problem: local could be NULL Added condition checks to address this issue Updates: bz#1622665 Change-Id: I7be7dacc5386a77441385240b43f22d85074b69d Signed-off-by: Sheetal Pamecha <sheetal.pamecha08@gmail.com>
* xlators/experimental: move template files to '.c.in' typeAmar Tumballi2018-10-0513-1691/+1598
| | | | | | | | | | | | | | | | | | | | | | This is critical because we shouldn't be applying the automated coding standard (clang-format) tool on these files. This patchset is done by below steps: * clang-format -i ${filename} This creates syntax errors. Fix them using below two commands: * sed -i -e 's/ @/@/g' ${filename} * sed -i -e 's/,@/, @/g' ${filename} With this, these files are having minimum changes requried to compile, and is as close to the coding standard as possible. * git rename ${filename} ${filename}.in Updates: bz#1564149 Change-Id: Icf90f7f81d6fa4400be4826e094fdff8e64508d0 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* dht: coverity fixesSusant Palai2018-10-054-35/+30
| | | | | | | | | | CID: 1356541 Issue: Dereference null return value CID: 1382411 Issue: Dereference after null check CID: 1391409 Issue: Unchecked return value Change-Id: Id3d4feb4e88df424003cc8e8a1540e77bbe030e3 Updates: bz#789278 Signed-off-by: Susant Palai <spalai@redhat.com>
* features/compress: NULL pointer dereferencing clang fixHarpreet Lalwani2018-10-051-2/+5
| | | | | | | | | Added a Label "err" to avoid NULL pointer dereferencing Updates: bz#1622665 Change-Id: I7ec02a9cbbc482c2cf77f66e5692e86cd251cd53 Signed-off-by: Harpreet Lalwani <hlalwani@redhat.com>
* cloudsync: coverity fixSusant Palai2018-10-051-1/+1
| | | | | | | | | | | CID: 1394631 1394634 1394643 1394645 1394652 1394655 1394661 1394666 1394669 1394670 1394671 Issue: Argument cannot be negative Change-Id: Id4a9b1adcc271374971e788f161d91e8c9ac442f Updates: bz#789278 Signed-off-by: Susant Palai <spalai@redhat.com>
* dht: volume_options 'options' collision with nfs-ganesha's 'options'Kaleb S. KEITHLEY2018-10-044-7/+11
| | | | | | | | | | | | | | | | | When dht was converted to xlator_api, the variable 'options' was not changed to dht_options, the same as was done to all the other xlators that were converted to xlator_api. Thus the reference to 'options' in dht.c is not resolved until runtime, and the RTlinker's search path starts with symbols in the executable, i.e. ganesha.nfsd's 'options'. (Which is obviously not the right one.) The unused extern references to 'options' (now dht_options) in nufa.c and switch.c is curious. Change-Id: Idf4a5d5fbd39aadfa5a4b529bceea65a3cbdf8f3 updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* mgmt/glusterd: use proper path to the volfileRaghavendra Bhat2018-10-043-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Till now, glusterd was generating the volfile path for the snapshot volume's bricks like this. /snaps/<snap name>/<brick volfile> But in reality, the path to the brick volfile for a snapshot volume is /snaps/<snap name>/<snap volume name>/<brick volfile> The above workaround was used to distinguish between a mount command used to mount the snapshot volume, and a brick of the snapshot volume, so that based on what is actually happening, glusterd can return the proper volfile (client volfile for the former and the brick volfile for the latter). But, this was causing problems for snapshot restore when brick multiplexing is enabled. Because, with brick multiplexing, it tries to find the volfile and sends GETSPEC rpc call to glusterd using the 2nd style of path i.e. /snaps/<snap name>/<snap volume name>/<brick volfile> So, when the snapshot brick (which is multiplexed) sends a GETSPEC rpc request to glusterd for obtaining the brick volume file, glusterd was returning the client volume file of the snapshot volume instead of the brick volume file. Change-Id: I28b2dfa5d9b379fe943db92c2fdfea879a6a594e fixes: bz#1635050 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
* glusterd: ignore RPC events when glusterd is shutting downAtin Mukherjee2018-10-041-1/+11
| | | | | | | | | | | | | | | When glusterd receives a SIGTERM while it receives RPC connect/disconnect/destroy events, the thread might lead to a crash while accessing rcu_read_lock () as the clean up thread might have already freed up the resources. This is more observable when glusterd comes up with upgrade mode = on during upgrade process. The solution is to ignore these events if glusterd is already in the middle of cleanup_and_exit (). Fixes: bz#1635593 Change-Id: I12831d31c2f689d4deb038b83b9421bd5cce26d9 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* mgmt/glusterd: NULL pointer dereferencing clang fixIraj Jamali2018-10-031-15/+16
| | | | | | | | | Added checks to avoid NULL pointer dereferencing Updates: bz#1622665 Change-Id: I745c1f3ba4df0e486ce99301843f9f13d01c00e0 Signed-off-by: Iraj Jamali <ijamali@redhat.com>
* mgmt/glusterd: NULL pointer deferencing clang fixIraj Jamali2018-10-026-6/+6
| | | | | | | | | Changed this->name to "glusterd" Updates: bz#1622665 Change-Id: Ic8ce428cefd6a5cecf5547769d8b13f530065c56 Signed-off-by: Iraj Jamali <ijamali@redhat.com>
* python: remove shebangs of non-main scripts and make others executableNiels de Vos2018-10-026-2/+0
| | | | | | | | | | | | | | | Some of the scripts that have a #!/usr/bin/python3 shebang do not have a main() like function. These scripts will not get executed but only imported. They do not need the shebang. A few others are not installed with 'make install', but do have a main() like function. These scripts are expected to be used by developers for different tasks (mostly code generation). Marking these scripts executable to make it easier to identify them. Change-Id: I73541471deb7e0830766b804786244e73dfe4221 Updates: #411 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* index : fix coverity issues in index.cSunny Kumar2018-10-011-4/+13
| | | | | | | | This patch fixes CID 1356508 and 1356577. Change-Id: I09bc5398fbf6ee49fc066b42aaedf1170df39df8 updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* fuse: prevent error message "can't shift that many"Niels de Vos2018-10-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | On systems where /bin/sh is not Bash, running plain mount.glusterfs gives the unhelpful error "can't shift that many". The argument parsing can be a little improved. Adding a check for the number of arguments, minimal two (Gluster ip:/volume, and mountpoint), but possibly more (-o, -v etc.). With the additional check, running 'mount.glusterfs -h' now shows the following messags: Usage: /sbin/mount.glusterfs <server>:<volume/subdir> <mountpoint> -o<options> Options: man 8 mount.glusterfs To display the version number of the mount helper: /sbin/mount.glusterfs -V Change-Id: I50e3ade0c6217fab4155f35ad8cb35d99d52e133 Fixes: bz#1564890 Reported-by: Alexander Zimmermann <alexander.zimmermann96@gmail.com> Signed-off-by: Niels de Vos <ndevos@redhat.com>
* glusterd: fix coverity issuesSanju Rakonde2018-10-012-2/+3
| | | | | | | | | | | This patch fixes CID 1274175, 1175018. 1274175: Buffer size warning 1175018: Resource leak Change-Id: Id18960c249447b8dae35de3ad92bc570e62ddb09 updates: bz#789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* mdcache: Fix asan reported potential heap buffer overflowShyamsundarR2018-09-281-0/+1
| | | | | | | | | | | | | | The char pointer mdc_xattr_str in function mdc_xattr_list_populate is malloc'd and doing a strcat into a malloc'd region can overflow content allocated based on prior contents of the memory region. Added a NULL terimation to the malloc'd region to prevent the overflow, and treat it as an empty string. Change-Id: If0decab669551581230a8ede4c44c319ff04bac9 Updates: bz#1633930 Signed-off-by: ShyamsundarR <srangana@redhat.com>
* glusterd: make sure that brickinfo->uuid is not nullSanju Rakonde2018-09-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: After an upgrade from the version where shared-brick-count option is not present to a version which introduced this option causes issue at the mount point i.e, size of the volume at mount point will be reduced by shared-brick-count value times. Cause: shared-brick-count is equal to the number of bricks that are sharing the file system. gd_set_shared_brick_count() calculates the shared-brick-count value based on uuid of the node and fsid of the brick. https://review.gluster.org/#/c/glusterfs/+/19484 handles setting of fsid properly during an upgrade path. This patch assumed that when the code path is reached, brickinfo->uuid is non-null. But brickinfo->uuid is null for all the bricks, as the uuid is null https://review.gluster.org/#/c/glusterfs/+/19484 couldn't reached the code path to set the fsid for bricks. So, we had fsid as 0 for all bricks, which resulted in gd_set_shared_brick_count() to calculate shared-brick-count in a wrong way. i.e, the logic written in gd_set_shared_brick_count() didn't work as expected since fsid is 0. Solution: Before control reaches the code path written by https://review.gluster.org/#/c/glusterfs/+/19484, adding a check for whether brickinfo->uuid is null and if brickinfo->uuid is having null value, calling glusterd_resolve_brick will set the brickinfo->uuid to a proper value. When we have proper uuid, fsid for the bricks will be set properly and shared-brick-count value will be caluculated correctly. Please take a look at the bug https://bugzilla.redhat.com/show_bug.cgi?id=1632889 for complete RCA Steps followed to test the fix: 1. Created a 2 node cluster, the cluster is running with binary which doesn't have shared-brick-count option 2. Created a 2x(2+1) volume and started it 3. Mouted the volume, checked size of volume using df 4. Upgrade to a version where shared-brick-count is introduced (upgraded the nodes one by one i.e, stop the glusterd, upgrade the node and start the glusterd). 5. after upgrading both the nodes, bumped up the cluster.op-version 6. At mount point, df shows the correct size for volume. fixes: bz#1632889 Change-Id: Ib9f078aafb15e899a01086eae113270657ea916b Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* Quota related files: use dict_{setn|getn|deln|get_int32n|set_int32n|set_strn}Yaniv Kaul2018-09-269-62/+107
| | | | | | | | | | | | | | In a previous patch (https://review.gluster.org/20769) we've added the key length to be passed to dict_* funcs, to remove the need to strlen() it. This patch moves some code to use it. Please review carefully. Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: If4f425a9827be7c36ccfbb9761006ae824a818c6
* cluster/ec: variable-length array (VLA) declaration clang fixSheetal Pamecha2018-09-261-1/+1
| | | | | | | | | | | Problem: variable-length array size becomes zero Modified array size to size+1 while declaring Updates: bz#1622665 Change-Id: I98ee8447c87f37c36c49f50058292e8c1757a1f9 Signed-off-by: Sheetal Pamecha <sheetal.pamecha08@gmail.com>
* features/locks: NULL pointer deferencing clang fixIraj Jamali2018-09-261-3/+3
| | | | | | | | | Added checks to avoid NULL pointer dereferencing Updates: bz#1622665 Change-Id: I8e441c2931f406a6012e418127550bdf454a599a Signed-off-by: Iraj Jamali <ijamali@redhat.com>
* ctime: Provide noatime optionKotresh HR2018-09-2510-9/+139
| | | | | | | | | | | | | | | | | Most of the applications are {c|m}time dependant and very few are atime dependant. So provide noatime option to not update atime when ctime feature is enabled. Also this option has to be enabled with ctime feature to avoid unnecessary self heal. Since AFR/EC reads data from single subvolume, atime is only updated in one subvolume triggering self heal. updates: bz#1593538 Change-Id: I085fb33c882296545345f5df194cde7b6cbc337e Signed-off-by: Kotresh HR <khiremat@redhat.com>
* nfs : fix coverity issuesSunny Kumar2018-09-252-3/+7
| | | | | | | | Fixes 1388608 and 1274073. updates: bz#789278 Change-Id: Ibe2b948ae3b02feb938caffe81b2e484b4c7b221 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* features/marker: Avoid passing structures as parameters to functionsVijay Bellur2018-09-253-12/+15
| | | | | | | | | | | | | | | Fixes CIDs: 1388779,1390242,1390057 The patch does the following: 1. Changes the prototype of mq_inspect_file_xattr() and mq_xattr_state() to have a parameter of struct iatt * instead of struct iatt. 2. Remove unneeded struct iatt parameter from mq_inspect_directory_xattr() Change-Id: I1f6eabda042f0fe56d8c9bca010302f5e518dbe4 updates: bz#789278 Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* glusterd: fix coverity issuesSanju Rakonde2018-09-253-21/+11
| | | | | | | | | | | | | | | This patch addreeses CID 1124812, 11248123, 1124833, and 1351706 1. We have a null check after GF_ASSERT. GF_ASSERT does a null check and fails if it is null. So removing the redundant null checks. 2. Added a log message to avoid unused value coverity issue Change-Id: Ib0d6dad8f40474afc8e5e60a531d37247cc8a081 updates: bz#789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* mgmt/glusterd: NULL pointer dereferencing clang fixShwetha Acharya2018-09-251-0/+6
| | | | | | | | Added a condition check to resolve the issue Change-Id: I1954e91f7487c052caf5cf98c954d204242f0af9 Updates: bz#1622665 Signed-off-by: Shwetha Acharya <sacharya@redhat.com>
* dht: Coverity fixesSusant Palai2018-09-242-2/+3
| | | | | | | | | | | CID: 1274236 Issue: Logically dead code (op_errno will never be -1) CID: 1351652 Issue: Dereference after null check. (local->fd is dereferenced anyway and it should not be NULL ever for dht_readdirp_cbk.) Change-Id: Ied9c5f5b72536be1ca944237165acdc62b792e58 updates: bz#789278 Signed-off-by: Susant Palai <spalai@redhat.com>
* glusterd: reduce length allocated to nameSanju Rakonde2018-09-222-2/+2
| | | | | | | | | In glusterd_proc_ and glusterd_svc_ structures name is having length of PATH_MAX, allocating NAME_MAX will be sufficient. Change-Id: I637ba00e1a80ca6a1ecc0c2dbf180c4633c1ca5b updates: bz#1193929 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* glusterd: fix resource leak coverity issuesSanju Rakonde2018-09-223-8/+4
| | | | | | | | | | This patch addresses CID 1288098,1370948 and 1382454 key_fixed is allocated with memory but missed to free it. updates: bz#789278 Change-Id: Iea805c668ba89759313f9e21b328757e570be97b Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* glusterd: fix coverity issues in glusterd-locks.cSanju Rakonde2018-09-221-2/+11
| | | | | | | | | | | | | This patch addresses CID 1395254, CID 1382436. We are allocating memory to mgmt_lock_timer and key_dup. while doing GF_VALIDATE_OR_GOTO for mgmt_lock_timer_xl or mgmt_lock_timer_ctx, if it is null going to out without freeing the memory. This patch will fix the issues. updates: bz#789278 Change-Id: Ic6bfb2052982b16373f90cbbc53d2b2da052c01f Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* glusterd: don't wait for blockers flag for stop volumeAtin Mukherjee2018-09-221-1/+0
| | | | | | | | | | | | | | | With commit 4f6ae8 even though the overall transaction time for gluster volume stop can be reduced, but based on testing it can't be guaranteed that the transaction can finish in 3 minutes before the unlock timer gets kicked in. The ground problem to this is the command serialization which atomic field 'blockers' does for volume stop operation. This patch removes that dependency for volume stop not to wait for blockers. Change-Id: Ifaf120115dc7ed21cf21e65e25c4ec7c61ab8258 Fixes: bz#1631128 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>