summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* glusterfs: During reconfigure set log-level per xlator levelMohit Agrawal2018-10-241-1/+31
| | | | | | | | | | | | | | | | Problem: In brick_mux environment, while a user has enabled brick-log-level for anyone volume, it automatically enables for other volumes also those are attached with same brick. Solution: A log-level option is automatically enabled for other volumes because log-level saved in glusterfsd_ctx and ctx is common for volumes those are attached with same brick. To resolve it set log level for all children xlator's at the time of the graph reconfigure at io-stat xlator. Change-Id: Id9a6efa05d286e0bea2d47f49292d084e7bb2fcf fixes: bz#1640495 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* glusterd: set integer instead of stringSanju Rakonde2018-10-243-6/+6
| | | | | | | | | | | | | | dict_get_str_boolean expects a integer, so we need to set all the boolean variables as integers to avoid log messages like below: [2018-09-10 03:55:19.236387] I [dict.c:2838:dict_get_str_boolean] (-->/usr/local/lib/libgfrpc.so.0(rpc_clnt_reconnect+0xc2) [0x7ff7a83d0452] -->/usr/local/lib/glusterfs/4.2dev/rpc-transport/socket.so(+0x65b0) [0x7ff7a06cf5b0] -->/usr/local/lib/libglusterfs.so.0(dict_get_str_boolean+0xcf) [0x7ff7a85fc58f] ) 0-dict: key transport.socket.ignore-enoent, integer type asked, has string type [Invalid argument] This patch addresses all such instances in glusterd. Change-Id: I7e1979fcf381363943f4d09b94c3901c403727da updates: bz#1193929 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cli: Fix heap-buffer-overflow issue reported by ASANKotresh HR2018-10-241-1/+4
| | | | | | | | | | | | | | | | | | | | GF_MALLOC was being used to allocate memory which is not initialized. strcat is used on it which could result in buffer overflow if it contains garbage before '\0'. So changed it to GF_CALLOC. Traceback: ==23427==ERROR: AddressSanitizer: heap-buffer-overflow ... WRITE of size 5 at 0x6080000083fe thread T3 #0 0x7fb60966991c in __interceptor_strcat ... #1 0x48adc0 in config_parse ... #2 0x48cde8 in cli_cmd_gsync_set_parse ... ... Updates: bz#1633930 Change-Id: I3710f011d8139984b1898265d84d150c9bdc962b Signed-off-by: Kotresh HR <khiremat@redhat.com>
* cluster/afr : Check for UP bricks before starting healAshish Pandey2018-10-243-1/+19
| | | | | | | | | | | | | | | | | | | | | | | Problem: Currently for replica volume, even if only one brick is UP SHD will keep crawling index entries even if it can not heal anything. In thin-arbiter volume which is also a replica 2 volume, this causes inode lock contention which in turn sends upcall to all the clients to release notify locks, even if it can not do anything for healing. This will slow down the client performance and kills the purpose of keeping in memory information about bad brick. Solution: Before starting heal or even crawling, check if sufficient number of children are UP and available to check and heal entries. Change-Id: I011c9da3b37cae275f791affd56b8f1c1ac9255d updates: bz#1640581 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* glusterd: improve logging for stage_deleted flagSanju Rakonde2018-10-232-0/+8
| | | | | | Change-Id: I5f0667a47ddd24cb00949c875c19f3d1dbd8d603 fixes: bz#1605077 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* rpc/rpc-lib: Uninitialized argument value of a functionHarpreet Lalwani2018-10-231-0/+3
| | | | | | | | | | | trav->saved_at.tv_sec is not initialized. Calling "list_empty" function before initializing "trav". Updates: bz#1622665 Change-Id: Ib5c2703a07a9c56ccd115001aca500f7a23c4a2e Signed-off-by: Harpreet Lalwani <hlalwani@redhat.com>
* md-cache: request cached xattrs at stat/fstatKinglong Mee2018-10-231-0/+20
| | | | | | | | | Ganesha always operate file by filehandle, and translates to glusterfs's stat/fstat many time. Change-Id: Idd0dc33c31131331ac948754c8b7f898777c31d3 Updates: bz#1634220 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
* tests: check for shd up status in bug-1637802-arbiter-stale-data-heal-lock.tRavishankar N2018-10-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: https://review.gluster.org/#/c/glusterfs/+/21427/ seems to be failing this .t spuriously. On checking one of the failure logs, I see: 22:05:44 Launching heal operation to perform index self heal on volume patchy has been unsuccessful: 22:05:44 Self-heal daemon is not running. Check self-heal daemon log file. 22:05:44 not ok 20 , LINENUM:38 In glusterd log: [2018-10-18 22:05:44.298832] E [MSGID: 106301] [glusterd-syncop.c:1352:gd_stage_op_phase] 0-management: Staging of operation 'Volume Heal' failed on localhost : Self-heal daemon is not running. Check self-heal daemon log file But the tests which preceed this check whether via a statedump if the shd is conected to the bricks, and they have succeeded and even started healing. From glustershd.log: [2018-10-18 22:05:40.975268] I [MSGID: 108026] [afr-self-heal-common.c:1732:afr_log_selfheal] 0-patchy-replicate-0: Completed data selfheal on 3b83d2dd-4cf2-4ea3-a33e-4275be40f440. sources=[0] 1 sinks=2 So the only reason I can see launching heal via cli failing is a race where shd has been spawned but glusterd has not yet updated in-memory that it is up, and hence failing the CLI. Fix: Check for shd up status before launching heal via CLI Change-Id: Ic88abf14ad3d51c89cb438db601fae4df179e8f4 fixes: bz#1641344 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* posix: fill glusterfs.posix.* acl xattrs at dictKinglong Mee2018-10-223-10/+86
| | | | | | Change-Id: I0730a037f96c4386c72ecf2f61c71ec17ffbc1b0 Updates: bz#1634220 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
* md-cache: fix dict leak of cached xattrKinglong Mee2018-10-221-0/+13
| | | | | | Change-Id: I52f8e13e68528ba9679537ffdddf58ec08f9fd0c Updates: bz#1634220 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
* xlators: some high severity coverity fixesBhumika Goyal2018-10-222-10/+35
| | | | | | | | Fixes: 124759 1288787 Change-Id: Ib8999242fc3ea5f4ea80246659899d2d4f06c506 updates: bz#789278 Signed-off-by: Bhumika Goyal <bgoyal@redhat.com>
* performance/write-behind: Fix NULL dereference issueVarsha Rao2018-10-221-2/+2
| | | | | | | | | This patches fixes the following coverity issues: CID: 1396101, 1396102 - Dereference null return value. Change-Id: I7ec783a61c06a1378863e974ff6e0baae418aec2 updates: bz#789278 Signed-off-by: Varsha Rao <varao@redhat.com>
* protocol/server: added check for positve value in server-handshake.cArjun Sharma2018-10-211-2/+3
| | | | | | | | This patch fixes CID 1124651 Change-Id: I6f33954f08cfdd7cb4236f9a81ec7980f81d19e7 updates: bz#789278 Signed-off-by: Arjun <arjsharm@redhat.com>
* rdma: coverity fixesBhumika Goyal2018-10-211-6/+7
| | | | | | | | Fixes CID: 1382442 1382415 1382379 1382355 Change-Id: Ia712e37cb5a6db452d3178386394f87f83b85d38 updates: bz#789278 Signed-off-by: Bhumika Goyal <bgoyal@redhat.com>
* mount/fuse: return ESTALE instead of ENOENT on all inode based operationsRaghavendra Gowdappa2018-10-201-2/+115
| | | | | | | | | | | | | | | | | | | | This patch is continuation of commit fb4b914ce84bc83a5f418719c5ba7c25689a9251. This patch extends that logic to all inode based operations and not just open(dir). <snip> mount/fuse: never fail open(dir) with ENOENT open(dir) being an operation on inode should never fail with ENOENT. If gfid is not present, the appropriate error is ESTALE. This will enable kernel to retry open after a revalidate lookup. </snip> Change-Id: I6313f520827e9af725485631cb6a9d9718243bc4 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Fixes: bz#1627620
* cluster/ec: NULL pointer deferencing clang fixSheetal Pamecha2018-10-191-2/+0
| | | | | | | | | Removing VALIDATE_OR_GOTO check on "this" Updates: bz#1622665 Change-Id: Ic7cffbb697da814f835d0ad46e25256da6afb406 Signed-off-by: Sheetal Pamecha <sheetal.pamecha08@gmail.com>
* storage/posix: Do not fail entry creation fops if gfid handle already existsKrutika Dhananjay2018-10-182-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PROBLEM: tests/bugs/shard/bug-1251824.t fails occasionally with EIO due to gfid mismatch across replicas on the same shard when dd is executed. CAUSE: Turns out this is due to a race between posix_mknod() and posix_lookup(). posix mknod does 3 operations, among other things: 1. creation of the entry itself under its parent directory 2. setting the gfid xattr on the file, and 3. creating the gfid link under .glusterfs. Consider a case where the thread doing posix_mknod() (initiated by shard) has executed steps 1 and 2 and is on its way to executing 3. And a parallel LOOKUP from another thread on noting that loc->inode->gfid is NULL, tries to perform gfid_heal where it attempts to create the gfid link under .glusterfs and succeeds. As a result, posix_gfid_set() through MKNOD (step 3) fails with EEXIST. In the older code, MKNOD under such conditions was NOT being treated as a failure. But commit e37ee6d changes this behavior by failing MKNOD, causing the entry creation to be undone in posix_mknod() (it's another matter that the stale gfid handle gets left behind if lookup has gone ahead and gfid-healed it). All of this happens on only one replica while on the other MKNOD succeeds. Now if a parallel write causes shard translator to send another MKNOD of the same shard (shortly after AFR releases entrylk from the first MKNOD), the file is created on the other replica too, although with a new gfid (since "gfid-req" that is passed now is a new UUID. This leads to a gfid-mismatch across the replicas. FIX: The solution is to not fail MKNOD (or any other entry fop for that matter that does posix_gfid_set()) if the .glusterfs link creation fails with EEXIST. Change-Id: I84a5e54d214b6c47ed85671a880bb1c767a29f4d fixes: bz#1638453 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* ctr: fix coverity issue in changetimerecorder.cMohit Agrawal2018-10-181-3/+1
| | | | | | | | | | This patch fixes CID: 1396179: Read from pointer after free 1396178: Use after free Change-Id: I47a2e4aa257e0c4dbdf2e1fd2e0748902764463f fixes: bz#789278 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* shard : fix newly introduced coveritySunny Kumar2018-10-181-1/+2
| | | | | | | | | This patch fixes CID: 1396177: NULL dereference. updates: bz#789278 Change-Id: Ic5d302a5e32d375acf8adc412763ab94e6dabc3d Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* debug/io-stats: io stats filenames contain garbageN Balachandran2018-10-171-4/+23
| | | | | | | | | | | | | | | As dict_unserialize does not null terminate the value, using snprintf adds garbage characters to the buffer used to create the filename. The code also used this->name in the filename which will be the same for all bricks for a volume. The files were thus overwritten if a node contained multiple bricks for a volume. The code now uses the conf->unique instead if available. Change-Id: I2c72534b32634b87961d3b3f7d53c5f2ca2c068c fixes: bz#1640165 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* api: fill out attribute information if not validRaghavendra Gowdappa2018-10-173-2/+147
| | | | | | | | | | | | | | | | | translators like readdir-ahead selectively retain entry information of iatt (gfid and type) when rest of the iatt is invalidated (for write invalidating ia_size, (m)(c)times etc). Fuse-bridge uses this information and sends only entry information in readdirplus response. However such option doesn't exist in gfapi. This patch modifies gfapi to populate the stat by forcing an extra lookup. Thanks to Shyamsundar Ranganathan <srangana@redhat.com> and Prashanth Pai <ppai@redhat.com> for tests. Change-Id: Ieb5f8fc76359c327627b7d8420aaf20810e53000 Fixes: bz#1630804 Signed-off-by: Raghavendra Gowdappa <rgowdapp@redhat.com> Signed-off-by: Soumya Koduri <skoduri@redhat.com>
* posix: return more xattrs at getxattr/fgetxattr when client requestKinglong Mee2018-10-171-2/+26
| | | | | | Change-Id: I37ac6186b3631979d2503d1b185a61b8094dbd0d Updates: bz#1634220 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
* nfs : fix coverity issue in nfs3.cSunny Kumar2018-10-161-1/+1
| | | | | | | | | This patch fixes CID 1274073. updates: bz#789278 Change-Id: I34146bfdfe19bae4592062e710a89ab07b2c5c07 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* trash : fix high sev coverity issue in trash.cSunny Kumar2018-10-161-0/+1
| | | | | | | | | This patch fixes CID 1288790: RESOURCE_LEAK. updates: bz#789278 Change-Id: I34bb410f1d3027e2d4c21044e87e319360344e04 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* glusterfsd: fix the asan leak messageAmar Tumballi2018-10-161-0/+1
| | | | | | | | | | | | | | | | | | | Fixes below trace of ASan: Direct leak of 130 byte(s) in 1 object(s) allocated from: #0 0x7fa794bb5850 in malloc (/lib64/libasan.so.4+0xde850) #1 0x7fa7944e5de9 in __gf_malloc ../../../libglusterfs/src/mem-pool.c:136 #2 0x40b85c in gf_strndup ../../../libglusterfs/src/mem-pool.h:166 #3 0x40b85c in gf_strdup ../../../libglusterfs/src/mem-pool.h:183 #4 0x40b85c in parse_opts ../../../glusterfsd/src/glusterfsd.c:1049 #5 0x7fa792a98720 in argp_parse (/lib64/libc.so.6+0x101720) #6 0x40d89f in parse_cmdline ../../../glusterfsd/src/glusterfsd.c:2041 #7 0x406d07 in main ../../../glusterfsd/src/glusterfsd.c:2625 updates: bz#1633930 Change-Id: I394b3fc24b7a994c1b03635cb5e973e7290491d3 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* servers-helpers.c: reduce clang warnings on dead initialization.Yaniv Kaul2018-10-161-464/+177
| | | | | | | | | | | | Assign a value to a parameter on its definition. Removes tens of clang warnings. Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I828bacb4033111af6162772a554cc5c6b2820169
* coverity: ignore tainted access reported in gf_freeShyamsundarR2018-10-161-0/+10
| | | | | | | | | | | | | | | | | | Coverity reports tainted pointer access in _gf_free if the pointer passed in was used by any IO related function by the caller. The taint within gf_free is a false positive, as the tainted region is from the passed in pointer till its allocated lenght, and not for contents before the pointer (i.e the GF_MEM_HEADER_SIZE bytes before the passed in pointer), as that is exclusively handled by the gf_alloc family of functions. CID: 1228602, 1292646, 1292647, 1292648, 1292649, 1383192, 1383195, 1389691 Should additionally fix, CID: 1292650, 1292651, 1357874, 1382373, 1382404, 1382407 Change-Id: I48c5a4028e7b0224c432bbc30f8c29408c2a466b Updates: bz#789278 Signed-off-by: ShyamsundarR <srangana@redhat.com>
* glusterfsd: Fix coverity issues around unused valuesShyamsundarR2018-10-161-0/+2
| | | | | | | | | | | | | | This patch fixes, CID: 1274064, 1274232 The fix is to not add into the return dict the throughput and time values on error computing the same. The pattern applied is the same as when an error occurs during adding either the throughput or the time value to the dict. Change-Id: I33e21e75efbc691f18b818934ef3bf70dd075097 Updates: bz#789278 Signed-off-by: ShyamsundarR <srangana@redhat.com>
* libgfapi: Send path with "." for the root when loc.parent is setKinglong Mee2018-10-161-1/+1
| | | | | | fixes: bz#1582516 Change-Id: Ia9649d7c3c0930dfec656d364cf6e9a98c774dd2 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
* gfapi: Bug fixes in leases processing code-pathSoumya Koduri2018-10-167-24/+65
| | | | | | | | | | | | | | This patch fixes below issues in gfapi lease code-path * 'glfs_setfsleasid' should allow NULL input to be able to reset leaseid * Applications should be allowed to (un)register for upcall notifications of type GLFS_EVENT_LEASE_RECALL * APIs added to read contents of GLFS_EVENT_LEASE_RECALL argument which is of type "struct glfs_upcall_lease" Change-Id: I3320ddf235cc82fad561e13b9457ebd64db6c76b updates: #350 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
* libglusterfs: fix sys_socket coverity issueMilind Changire2018-10-161-1/+2
| | | | | | | | CID 1396081: Control flow issues (UNREACHABLE) Change-Id: Ifad303853224cb9abc91c1083bb1529f4c13b1d3 updates: bz#789278 Signed-off-by: Milind Changire <mchangir@redhat.com>
* Multiple xlators: perform gettimeofday() not under lockYaniv Kaul2018-10-167-13/+42
| | | | | | | | | | | | | While it may slightly reduce accuracy, I think it's better to acquire the time outside a lock and then memcpy the value while under lock. Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: Ic8fb94a56c4fa2d3b13e59767e13646fb39342ba
* 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>
* core: libuuid-devel breakageKaleb S. KEITHLEY2018-10-162-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The #include "uuid.h" left over from using .../contrib/uuid is debatably incorrect now that we use the "system header" file /usr/include/uuid/uuid.h from libuuid-devel. Unfortunately this is complicated by things like FreeBSD having its own /usr/include/uuid.h, and the e2fsprogs-libuuid uuid.h in installed - as most third-party packages in FreeBSD are - in /usr/local as /usr/local/include/uuid/uuid.h With a system header file it should at least be #include <uuid.h>, and even better as #include <uuid/uuid.h>, much like the way <sys/types.h> and <net/if.h> are included. Using #include <uuid/uuid.h> guarantees not getting the /usr/include/uuid.h on FreeBSD, but clang/cc knows to find "system" header files like this in /usr/local/include; with or without the -I/... from uuid.pc. Also using #include "uuid.h" leaves the compiler free to find a uuid.h from any -I option it might be passed. (Fortunately we don't have any at this time.) As we now require libuuid-devel or e2fsprogs-libuuid and configure will exit with an error if the uuid.pc file doesn't exist, the HAVE_LIBUUID (including the #elif FreeBSD) tests in compat-uuid.h are redundant. We are guaranteed to have it, so testing for it is a bit silly IMO. It may also break building third party configure scripts if they omit defining it. (Just how hard do we want to make things for third party developers?) Change-Id: I7317f63c806281a5d27de7d3b2208d86965545e1 updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* features/shard: Hold a ref on base inode when adding a shard to lru listKrutika Dhananjay2018-10-166-21/+140
| | | | | | | | | | | | | | | | | | | | | | | | | 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-159-41/+52
| | | | | | | | | | | 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-122-3/+3
| | | | | | | | | | | | | | | | | | | | 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>
* cli: Fix memory leaks reported by ASANKotresh HR2018-10-121-0/+38
| | | | | | | | | This patch addresses memory leaks other than 'gf_cli_rsp' response structure. Updates: bz#1633930 Change-Id: Idc5940dca623e33bc01004a9324bc435fc60b006 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* libglusterfs : fix newly introduced coverity defectSunny Kumar2018-10-121-2/+0
| | | | | | | | CID: 1396060 updates: bz#789278 Change-Id: Ia25aa9a4ca7505e747aa92bb3ae81415da7d19d1 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* core: glusterfsd keeping fd open in index xlatorMohit Agrawal2018-10-124-25/+94
| | | | | | | | | | | | | | | | | | | | | | 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>
* libglusterfs: fix log message in options.cSheetal Pamecha2018-10-121-4/+2
| | | | | | | | | | | This patch fixes https://github.com/gluster/glusterfs/issues/519 Credits: "Fabian Wannenmacher <@wanneut>" Updates: bz#1193929 Change-Id: If8d60c3379093a868ad6ba8c2ad86a4b99d35f2c Signed-off-by: Sheetal Pamecha <sheetal.pamecha08@gmail.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>
* cli: Fix memory leaks reported by ASANKotresh HR2018-10-121-64/+52
| | | | | | | | | | 'gf_cli_rsp' structure has 'op_errstr' and 'dict.dict_val' which could get allocated by xdr and should be freed. This patch takes care of all instances of the same. Updates: bz#1633930 Change-Id: I2a5d129ffe85cfca743c89edb45b658f3ce688cb Signed-off-by: Kotresh HR <khiremat@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>
* socket: use accept4/paccept for nonblocking socketKrishnan Parthasarathi2018-10-125-16/+81
| | | | | | | | | | | | | | | | | This reduces the no. of syscalls on Linux systems from 2, accept(2) and fcntl(2) for setting O_NONBLOCK, to a single accept4(2). On NetBSD, we have paccept(2) that does the same, if we leave signal masking aside. Added sys_accept which accepts an extra flags argument than accept(2). This would opportunistically use accept4/paccept as available. It would fallback to accept(2) and fcntl(2) otherwise. While at this, the patch sets FD_CLOEXEC flag on the accepted socket fd. BUG: 1236272 Change-Id: I41e43fd3e36d6dabb07e578a1cea7f45b7b4e37f fixes: bz#1236272 Signed-off-by: Krishnan Parthasarathi <kparthas@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>