summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* socket: set FD_CLOEXEC on all socketsKrishnan Parthasarathi2018-10-114-3/+21
| | | | | | | | | For more information, see http://udrepper.livejournal.com/20407.html BUG: 1236272 Change-Id: I25a645c10bdbe733a81d53cb714eb036251f8129 fixes: bz#1236272 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
* README: add a section for giving hints on testingAmar Tumballi2018-10-111-0/+26
| | | | | | Change-Id: I1529494504c38172f56759c0f06231864e32df24 updates: bz#1193929 Signed-off-by: Amar Tumballi <amarts@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>
* gfapi: fix crash of using uninitialized fs->ctxKinglong Mee2018-10-101-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | 0 0x00007fb3db3a2ee4 in pub_glfs_fini (fs=0x7f8977d63f00) at glfs.c:1236 1 0x00007fb3db3a2065 in pub_glfs_new (volname=0x7f80de4d4d40 "openfs1") at glfs.c:784 2 0x00007fb3db5cf089 in glusterfs_get_fs (params=..., up_ops=up_ops@entry=0x7fb3ca643130) at /usr/src/debug/nfs-ganesha/src/FSAL/FSAL_GLUSTER/export.c:889 3 0x00007fb3db5cf99a in glusterfs_create_export ( fsal_hdl=0x7fb3db7e2490 <GlusterFS+112>, parse_node=0x7fb3ca6387d0, err_type=<optimized out>, up_ops=0x7fb3ca643130) at /usr/src/debug/nfs-ganesha/src/FSAL/FSAL_GLUSTER/export.c:1011 4 0x00007fb3e11c485f in mdcache_fsal_create_export ( sub_fsal=0x7fb3db7e2490 <GlusterFS+112>, parse_node=parse_node@entry=0x7fb3ca6387d0, err_type=err_type@entry=0x7fb3c0bef140, super_up_ops=<optimized out>) at /usr/src/debug/nfs-ganesha/src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_main.c:281 (gdb) p errno $1 = 12 Change-Id: I3dd5b84b52962ceb0b5d4f9b4f475bf4aa724292 updates: bz#1626313 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
* afr: prevent winding inodelks twice for arbiter volumesRavishankar N2018-10-102-1/+45
| | | | | | | | | | | | | | | | | | 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>
* libglusterfs: NULL pointer dereferencing clang fixIraj Jamali2018-10-101-0/+3
| | | | | | | | | Avoided NULL pointer dereferencing by doing GF_VALIDATE_OR_GOTO for rvec Updates: bz#1622665 Change-Id: I650e0203796dd705d79060f9506fc6c559b30f56 Signed-off-by: Iraj Jamali <ijamali@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>
* socket: clear return value if error is going to be handled in event threadKinglong Mee2018-10-101-0/+3
| | | | | | Change-Id: Ibce94f282b0aafaa1ca60ab927a469b70595e81f updates: bz#1626313 Signed-off-by: Zhang Huan <zhanghuan@open-fs.com>
* all: fix warnings on non 64-bits architecturesXavi Hernandez2018-10-1060-250/+251
| | | | | | | | | | 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>
* logging: fix file handle leak when calls glfs_set_logging more timesKinglong Mee2018-10-101-0/+7
| | | | | | | | Closes the log file and reopens it to prevent leakage of file handles. Change-Id: Idfaa479961bb0088004d0d5558bdb0eb32cff632 updates: bz#1626313 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
* libglusterfs/src/logging.c: reduce the use of stringsYaniv Kaul2018-10-101-124/+55
| | | | | | | | | | | | | | | | | | I did not see a good reason to copy the temp strings str1 and str2 into msg string, and just used str1 (sprintf'ed str2 into it first). Hope it makes logging somewhat faster, but I also hope there's more room for improvement for faster logging. Renamed str1 to logline and str2 to msg for better readability. Also, remove dead assignment in _gf_msg() (clang complained). Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I19457d705c0b043937d96a4db35d087bb8e9b35a
* features/snapview-client: replace gf_log with gf_msgRaghavendra Bhat2018-10-105-168/+207
| | | | | | 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>
* cli: memory leak issues reported by asanAmar Tumballi2018-10-093-5/+17
| | | | | | | | | With this fix, a run on 'rpc-coverage.t' passes properly. This should help to get started with other fixes soon! Change-Id: I257ae4e28b9974998a451d3b490cc18c02650ba2 updates: bz#1633930 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* cliutils : python2 to python3 compatSunny Kumar2018-10-091-13/+13
| | | | | | | | | | This patch fixes import issue in cliutils. Provided solution is to use relative import. Change-Id: I14c9a0b528ef52e7c91f6b17b569c68c2ced8912 updates: #411 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* extras: Script to collect system-statsPranith Kumar K2018-10-091-0/+52
| | | | | | | | | | | | | For debugging performance issues we found that this script is very useful. Script collects the stats of vmstat/iostat/top/sar to get metrics about memory/disk/cpu/network respectively at the configured interval. It is very important to collect all these metrics at the same time so that they can be correlated easily, so made this into a script fixes bz#1633926 Change-Id: Iea52e55179b21c505953722c8898293fe92cb8de Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>