summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* xlators/mgmt/glusterd/src/glusterd-volgen.c: use dict_ new functionsYaniv Kaul2018-12-051-237/+230
| | | | | | | | | | | | | | | 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 patches makes use of these functions over this whole file. Please review carefully, as there are many many changes there. Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I2e1ee340300ec330936c31becda6bfe1b6533281
* tests: Mark tests/bugs/shard/zero-flag.t badAtin Mukherjee2018-12-051-0/+1
| | | | | | Change-Id: I2f4ca470c6666584e0feb129ab712f06772a86c2 Updates: bz#1656264 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* glusterd: set cluster.max-bricks-per-process to 250Atin Mukherjee2018-12-051-1/+1
| | | | | | | | | Commit 6821cec changed this default from 0 to 250 in the option table, however the same wasn't done in the global option table. Change-Id: I6075f2ebc51e839510d6492fb62e706deb2d845b Fixes: bz#1652118 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* extras: Add group-distributed-virt for single-brick ovirt-gluster use-caseKrutika Dhananjay2018-12-053-2/+18
| | | | | | Change-Id: I930011327332b7ba30cc76f614efaf5932eb4f3d fixes: bz#1654138 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
* libglusterfs/src/iobuf.c: small refactor to re-use code.Yaniv Kaul2018-12-051-23/+13
| | | | | | | | | | No functional changes (I hope). Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: Ifbec21c18a6dbe27c5271db156bff4d30ca85dbf
* cli: fix memory leak in cli-cmd-system.cSunny Kumar2018-12-051-4/+11
| | | | | | | | | | This patch fixes memory leak reported by ASan. SUMMARY: AddressSanitizer: 384 byte(s) leaked in 2 allocation(s). updates: bz#1633930 Change-Id: I93ebddcfeea3d51547e00775db2c9d99f5dfafea Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* configure.ac: fix option to stop automake aborting on pointless errorEli Schwartz2018-12-042-2/+2
| | | | | | | | | | | | | | | | | | | | | | glusterfs does not follow the GNU coding standards and therefore must use the "foreign" strictness. Without this, autoreconf -fi would fail to execute successfully because automake returned non-zero. This change ensures that people using autoreconf, the GNU preferred invocation method for the autotools build system, can successfully set up the build. Remove the pointless --foreign argument from the autogen.sh invocation of automake. Not only is configure.ac the preferred way to define such options (rather than handwritten, piecemeal invocations of every tool in the autotools toolchain), it was never needed in the autogen.sh as that script provides no error handling at all and always (incorrectly) returns successfully as long as autotools itself is installed (no matter how broken glusterfs itself is). Change-Id: Ib0246d5368a54594f517a322465cffb9a85c1b49 fixes: bz#1656100 Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
* Do not blindly add volume share section to smb.confMilan Zink2018-12-042-5/+26
| | | | | | | | | | | | | With this change, by default GlusterFS volume share section will no longer be added to smb.conf for client access unless user.cifs or user.smb volume set options are enabled. This also fixes the hook script to check for presence of all configuration possibilities for those volume set options like 'enable' or 'on'. Change-Id: Ibecf7fffb4507d7255d963c3b1482afb0d0db984 Signed-off-by: Milan Zink <mzink@redhat.com> Signed-off-by: Anoop C S <anoopcs@redhat.com> Fixes: bz#1575836
* glusterd: migrating profile commands to mgmt_v3 frameworkSanju Rakonde2018-12-045-23/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Current profile commands use the op_state machine framework. Porting it to use the mgmt_v3 framework. The following tests were performed on the patch: case 1: 1. On a 3 node cluster, created and started 3 volumes 2. Mounted all the three volumes and wrote some data 3. Started profile operation for all the volumes 4. Ran "gluster v status" from N1, "gluster v profile <volname1> info" form N2, "gluster v profile <volname2> info" from N3 simultaneously in a loop for around 10000 times 5. Didn't find any cores generated. case 2: 1. Repeat the steps 1,2 and 3 from case 1. 2. Ran "gluster v status" from N1, "gluster v profile <volname1> info" form N2(terminal 1), "gluster v profile <volname2> info" from N2(terminal 2) simultaneously in a loop. 3. No cores were generated. fixes: bz#1654181 Change-Id: I83044cf5aee3970ef94066c89fcc41783ed468a6 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cli: "usage()" and "--help" for gluster cliHarpreet Kaur Lalwani2018-12-043-3/+33
| | | | | | | | | | | Added a usage message which will be shown when a user enters an "unrecognized word" or an "unrecognized command" on the cli. Also added a "--help" option for gluster cli. fixes: bz#1535495 Change-Id: Ibcfb3d1c84daa1054e09c5cdfa6a5dab19f534a6 Signed-off-by: Harpreet Kaur Lalwani <hlalwani@redhat.com>
* geo-rep: Fix syncing of files with non-ascii filenamesKotresh HR2018-12-045-69/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Creation of files/directories with non-ascii names fails to sync to the slave. It crashes with below traceback on slave. ... File "/usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon/repce.py", line 118, in worker res = getattr(self.obj, rmeth)(*in_data[2:]) File "/usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon/resource.py", line 709, in entry_ops [ESTALE, EINVAL, EBUSY]) File "/usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon/syncdutils.py", line 546, in errno_wrap return call(*arg) File "/usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon/libcxattr.py", line 83, in lsetxattr cls.raise_oserr() File "/usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon/libcxattr.py", line 38, in raise_oserr raise OSError(errn, os.strerror(errn)) OSError: [Errno 12] Cannot allocate memory Cause: The length calculation arguments passed to blob creation was done before encoding. Hence was failing in gfid-access layer. Fix: It appears that the calculating lenght properly fixes this issue. But it will cause issues in other places in 'python2' and not in 'python3'. So encoding and decoding each required string to make geo-rep compatible with both 'python2' and 'python3' is a nightmare and is not fool proof. Hence kept 'python2' code as is with out encode/decode and applied encode/decode only to 'python3' Added non-ascii filename tests to regression fixes: bz#1650893 Change-Id: I35cfaf848e07b1a0b5cb93c01b98b472f08271a6 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* rpc: bump up server.event-threadsMilind Changire2018-12-043-3/+3
| | | | | | | | | | | | | | | Problem: A single event-thread causes performance issues in the system. Solution: Bump up event-threads to 2 to make the system more performant. This helps in making the system more responsive and helps avoid the ping-timer-expiry problem as well. However, setting the event-threads to 2 is not the only thing required to avoid ping-timer-expiry issues. Change-Id: Idb0fd49e078db3bd5085dd083b0cdc77b59ddb00 fixes: bz#1653277 Signed-off-by: Milind Changire <mchangir@redhat.com>
* io-cache: xdata needs to be passed for readv operationsSoumya Koduri2018-12-042-2/+16
| | | | | | | | | | | | io-cache xlator has been skipping xdata references when the date needs to be read into page cache. This patch fixes the same. Note: similar changes may be needed for other fops as well which are handled by io-cache. Change-Id: I28d73d4ba471d13eb55d0fd0b5197d222df77a2a updates: bz#1648768 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
* rpc: check if fini is there before calling itRaghavendra Bhat2018-12-041-1/+3
| | | | | | | | | | | | | | | The rpc_transport_t structure is allocated and filled in the rpc_transport_load function. If filling the fileds of the rpc structure fails, then in the failure handling the structure is freed by rpc_transport_cleanup. There, it unconditionally calls fini. But, if the failure handling was invoked because of any failure in between the allocation of rpc_transport_t and filling the transport->fini (including the failure to fill fini ()), then rpc_transport_cleanup can lead to a segfault. Change-Id: I8be9b84cd6b19933c559c9736198a6e440373f68 fixes: bz#1654917 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
* glusterd: perform rcu_read_lock/unlock() under cleanup_lock mutexSanju Rakonde2018-12-0316-199/+213
| | | | | | | | | | | | | | Problem: glusterd should not try to acquire locks on any resources, when it already received a SIGTERM and cleanup is started. Otherwise we might hit segfault, since the thread which is going through cleanup path will be freeing up the resouces and some other thread might be trying to acquire locks on freed resources. Solution: perform rcu_read_lock/unlock() under cleanup_lock mutex. fixes: bz#1654270 Change-Id: I87a97cfe4f272f74f246d688660934638911ce54 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cli : Memeory leak fix reported by ASANSunny Kumar2018-12-031-0/+22
| | | | | | | | | | | | | This patch fixes memory leak in cli-rpc-ops.c. Functions: gf_cli_create_volume_cbk, gf_cli_delete_volume_cbk, gf_cli_start_volume_cbk, gf_cli_remove_tier_brick_cbk, gf_cli_list_volume_cbk. updates: bz#1633930 Change-Id: I68a650fb972db18c90e6581a960eae3018f32d40 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* server: Resolve memory leak path in server_initMohit Agrawal2018-12-0311-49/+151
| | | | | | | | | | | | | | Problem: 1) server_init does not cleanup allocate resources while it is failed before return error 2) dict leak at the time of graph destroying Solution: 1) free resources in case of server_init is failed 2) Take dict_ref of graph xlator before destroying the graph to avoid leak Change-Id: I9e31e156b9ed6bebe622745a8be0e470774e3d15 fixes: bz#1654917 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* features/bitrot: compare the signature with proper lengthRaghavendra Bhat2018-12-032-8/+14
| | | | | | | | | | | | | | | | | | | | | * The scrubber was comparing the checksum of the file that it calculated (by reading the file) with the on disk signature (stored via xattr) wrongly. It was using strlen to calculate the signature, while the actual length of the signature is given by the brick. Just use the actual length that the brick provides instead of trying to calculate the signature length via strlen API. * In posix, gfid2path was using the same string that contains the list of all the xattrs of file to save the value of the gfid2path xattr as well. This causes confusion when gfid2path xattr is queried by scrubber for getting the actual path of a corrupted file. Use separate string to fetch the value of the xattr instead of the string that contains the list of xattrs. Change-Id: I2d664ab524d2b312233476cb35863dde3122e9a9 fixes: bz#1654805 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
* afr: assign gfid during name heal when no 'source' is present.Ravishankar N2018-12-035-52/+201
| | | | | | | | | | | | | | | | | | Problem: If parent dir is in split-brain or has dirty xattrs set, and the file has gfid missing on one of the bricks, then name heal won't assign the gfid. Fix: Use the brick we select the gfid from as the 'source'. Note: Problem was found while trying to debug a split-brain issue on Cynthia Zhou's setup. updates: bz#1637249 Change-Id: Id088d4f0fb017aa35122de426654194e581ed742 Reported-by: Cynthia Zhou <cynthia.zhou@nokia-sbell.com> Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* doc: Add brick mux thread reduction design doc in developer guidePoornima G2018-12-032-0/+69
| | | | | | Change-Id: I5309efb5826d4385eadea29c1cf973f504eef9e5 Updates: #475 Signed-off-by: Poornima G <pgurusid@redhat.com>
* leases: Do not conflict with internal fopsSoumya Koduri2018-12-031-0/+11
| | | | | | | | | | | | | | Internal fops (with frame->root->pid < 0) are used to heal or move data and maintains data integrity. That is they do not modify client data which holds the lease. Hence no need to recall Lease for such fops. Note: Like for locks, we would need rebalance and self-heal daemon process to heal lease state as well. Change-Id: I8988693fef8d00e17c19dcc842e2238f9eb5ab48 updates: bz#1648768 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
* rpc *.h fles: align structsYaniv Kaul2018-12-038-106/+100
| | | | | | | | Make an effort to slightly better align the structures. Change-Id: I6f80a451f2ffbf15adfb986cedc24c2799787b49 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* nfs : set ctx for every inode looked up nfs3_fh_resolve_inode_lookup_cbk()Jiffin Tony Thottan2018-12-031-0/+6
| | | | | | | | | | | | The inode ctx for nfs xlator is set with help nfs_fix_generation. But currently gnfs is crashing because inode_ctx is becoming null nfs3_resolve_inode_hard() is used to perform a lookup on entire path and looks like function is missing to set the ctx for inode. This patch will set ctx for the inode which it looked on. Change-Id: I464fa7f78df1bae990ebe97de8ccf6d5fb74fc9f fixes: bz#1651439 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
* cli: memory leak issue reported by asanHarpreet Lalwani2018-12-031-0/+3
| | | | | | | | | | | This patch fixes Indirect leaks in tests/bugs/heal-symlinks.t. Leaks are happening in cli_cmd_volume_heal_cbk. SUMMARY: AddressSanitizer: 640 byte(s) leaked in 4 allocation(s). Updates: bz#1633930 Change-Id: I970b4229630fdaf01aec66581c1287beef7560a3 Signed-off-by: Harpreet Lalwani <hlalwani@redhat.com>
* clang: Fix io-stats.c NULL pointer issue reported by clangShyamsundarR2018-12-031-5/+6
| | | | | | | | | | | | | | | | The issue pertains to checking if conf is NULL in BUMP_FOP but not providing that safety in io_stats_release when using conf to lock and bump nr_opens. This is now corrected to check if conf is non-NULL before attempting the lock and bump nr_opens. Tested with local clang analyzer to ensure this fixes the problem. Change-Id: Iffd6a97c2060d0a6930a8dc5914b1956c192cab1 Updates: bz#1622665 Signed-off-by: ShyamsundarR <srangana@redhat.com>
* cli : Memeory leak fix reported by ASANSunny Kumar2018-12-021-0/+3
| | | | | | | | | | | | This patch fixes memory leak in cli-rpc-ops.c. All leaks are happening in gf_cli_remove_brick_cbk. SUMMARY: AddressSanitizer: 2944 byte(s) leaked in 22 allocation(s). updates: bz#1633930 Change-Id: I1e58d538eb9135f1aadcdb54d10b72f55e8a53d1 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* Multiple xlator .h files: remove unused private gf_* memory types.Yaniv Kaul2018-11-3016-111/+47
| | | | | | | | | | | | | It seems there were quite a few unused enums (that in turn cause unndeeded memory allocation) in some xlators. I've removed them, hopefully not causing any damage. Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I8252bd763dc1506e2d922496d896cd2fc0886ea7
* clang: Fix clang warnings in snapview-server.cShyamsundarR2018-11-291-12/+0
| | | | | | | | | | | | | | | | | | | | | The warning by clang is due to the fact that we check for frame->root to be NULL, but in stack unwind, we ignore the same. If frame is non-NULL then frame->root is non-NULL as frame creation ensures this. Further, across the code we do not check both frame and frame->root for validity. Hence to fix these clang issues, removing the check for frame->root in the various functions. NOTE: Initially clang reported 14 issues in the file, but post commit 6eabefe6 the number reduced to 4, unsure why as that commit does not address this issue. Change-Id: I04b63f2d006a1f95773aae9f904b4bd3d5118e62 Updates: bz#1622665 Signed-off-by: ShyamsundarR <srangana@redhat.com>
* rpcsvc: provide each request handler thread its own queueRaghavendra Gowdappa2018-11-2914-177/+479
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A single global per program queue is contended by all request handler threads and event threads. This can lead to high contention. So, reduce the contention by providing each request handler thread its own private queue. Thanks to "Manoj Pillai"<mpillai@redhat.com> for the idea of pairing a single queue with a fixed request-handler-thread and event-thread, which brought down the performance regression due to overhead of queuing significantly. Thanks to "Xavi Hernandez"<xhernandez@redhat.com> for discussion on how to communicate the event-thread death to request-handler-thread. Thanks to "Karan Sandha"<ksandha@redhat.com> for voluntarily running the perf benchmarks to qualify that performance regression introduced by ping-timer-fixes is fixed with this patch and patiently running many iterations of regression tests while RCAing the issue. Thanks to "Milind Changire"<mchangir@redhat.com> for patiently running the many iterations of perf benchmarking tests while RCAing the regression caused by ping-timer-expiry fixes. Change-Id: I578c3fc67713f4234bd3abbec5d3fbba19059ea5 Fixes: bz#1644629 Signed-off-by: Raghavendra Gowdappa <rgowdapp@redhat.com>
* core: ctx calls naked calloc()Kaleb S. KEITHLEY2018-11-281-1/+1
| | | | | | | | | | | | | | | | liblglusterfs provides wrapper functions MALLOC/__gf_default_malloc, CALLOC/__gf_default_calloc, and REALLOC/__gf_default_realloc for those few places outside of mempool.c that need to call malloc/calloc/realloc directly. Notable exceptions are "contrib" code, e.g. rbtree and timer-wheel, and perhaps parsers generated by yacc+lex. But even parsers can be fixed to at least call the wrappers mentioned above, if not our own allocators. Change-Id: Ib8069815eba9b6c04c3adaf59727ec8d8795c4d1 updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* libglusterfs: rename macros roof and floor to not conflict with math.hRaghavendra Gowdappa2018-11-289-31/+32
| | | | | | Change-Id: I666eeb63ebd000711b3f793b948d4e0c04b1a242 Signed-off-by: Raghavendra Gowdappa <rgowdapp@redhat.com> Updates: bz#1644629
* glusterd: volume-ops calls naked mallocKaleb S. KEITHLEY2018-11-281-2/+2
| | | | | | | | | | | | | | | | libglusterfs provides wrapper functions MALLOC/__gf_default_malloc, CALLOC/__gf_default_calloc, and REALLOC/__gf_default_realloc for those few places outside of mempool.c that need to call malloc/calloc/realloc directly. Notable exceptions are "contrib" code, e.g. rbtree and timer-wheel, and perhaps parsers generated by yacc+lex. But even parsers can be fixed to at least call the wrappers mentioned above, if not our own allocators Change-Id: Ie6156307b6d2183be9c9aff153afb7598974f4e4 updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* tests/geo-rep: Add Arbiter volume test caseHarpreet Kaur2018-11-282-0/+439
| | | | | | | | | Added geo-rep regression tests with Arbiter volume. Fixes: bz#1653565 Change-Id: Id99523c1f1d3d301fbe871aa0641d9ae4ed7b8d7 Signed-off-by: Harpreet Kaur <hlalwani@redhat.com>
* posix: fix memory leakAmar Tumballi2018-11-282-7/+23
| | | | | | | | | | | | | | | | | | | | | | | Direct leak of 609960 byte(s) in 4485 object(s) allocated from: #0 0x7f0d719bea50 in __interceptor_calloc (/lib64/libasan.so.5+0xefa50) #1 0x7f0d716dc08f in __gf_calloc ../../../libglusterfs/src/mem-pool.c:111 #2 0x7f0d5d41d9b2 in __posix_get_mdata_xattr ../../../../../xlators/storage/posix/src/posix-metadata.c:240 #3 0x7f0d5d41dd6b in posix_get_mdata_xattr ../../../../../xlators/storage/posix/src/posix-metadata.c:317 #4 0x7f0d5d39e855 in posix_fdstat ../../../../../xlators/storage/posix/src/posix-helpers.c:685 #5 0x7f0d5d3d65ec in posix_create ../../../../../xlators/storage/posix/src/posix-entry-ops.c:2173 Direct leak of 609960 byte(s) in 4485 object(s) allocated from: #0 0x7f0d719bea50 in __interceptor_calloc (/lib64/libasan.so.5+0xefa50) #1 0x7f0d716dc08f in __gf_calloc ../../../libglusterfs/src/mem-pool.c:111 #2 0x7f0d5d41ced2 in posix_set_mdata_xattr ../../../../../xlators/storage/posix/src/posix-metadata.c:359 #3 0x7f0d5d41e70f in posix_set_ctime ../../../../../xlators/storage/posix/src/posix-metadata.c:616 #4 0x7f0d5d3d662c in posix_create ../../../../../xlators/storage/posix/src/posix-entry-ops.c:2181 We were freeing only the first context in inode during forget, and not the second. updates: bz#1633930 Change-Id: Ib61b4453aa3d2039d6ce660f52ef45390539b9db Signed-off-by: Amar Tumballi <amarts@redhat.com>
* mem-pool: minor fix and clarificationXavi Hernandez2018-11-281-3/+10
| | | | | | | | | | A comment has been added to pool_destructor() function to explain why locks are not needed there. Also, the initialization of 'poison' field has been moved inside a locked region for further safety and clarity. Change-Id: Idbf23bda7f9228d60c644a1bea4b6c2cfc582090 updates: bz#1193929 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* geo-rep: Geo-rep help text issueShwetha K Acharya2018-11-271-4/+6
| | | | | | | | Modified Geo-rep help text for better sanity. Change-Id: I48f4d0fd60c1ffcde753b37416e0c73afd0b5702 fixes: bz#1652887 Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
* glusterd: perform store operation in cleanup lockAtin Mukherjee2018-11-273-35/+47
| | | | | | | | | All glusterd store operation and cleanup thread should work under a critical section to avoid any partial store write. Change-Id: I4f12e738f597a1f925c87ea2f42565dcf9ecdb9d Fixes: bz#1652430 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* glusterd : fix high sev coverity issueSunny Kumar2018-11-271-3/+2
| | | | | | | | This patch fixes CID : 1174824 : RESOURCE_LEAK Change-Id: I59d2d6ebc1fa3d7ebe0b97c7dbe3c5539128522a updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* libglusterfs/src/dict.c : consistent initialization of parameters.Yaniv Kaul2018-11-271-60/+29
| | | | | | | | | | | | | | | | Some were assigned NULL, for no good reason, some were assigned proper initial value. Made them all consistent, as much as possible, to be assigned reasonable initial values. No expected functional changes (and I also assume the compiler already did most of this work behind the scenes anyway, so no performance implications either). Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I2bc0d4f2221124b5f9ef6150c86b7259074e7013
* build: add option to compile with ThreadSanitizerNiels de Vos2018-11-272-0/+30
| | | | | | | | | | | | ThreadSanitizer is a debugging tool that can detect threads that race for data modifications. These races can result in data corruption and are difficult to track and fix. Change-Id: Ibbdaf17c811e30e79cd5bdcf9cd9ff2d0cdb2abb URL: https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual Reported-by: Yaniv Kaul <ykaul@redhat.com> Fixes: #543 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* glfsheal: add a '--nolog' flagRavishankar N2018-11-264-17/+56
| | | | | | | | | | | | | | | | | | | | | ....and if set, change the log level to GF_LOG_NONE. This is useful for monitoring applications which invoke the heal info set of commands once every minute, leading to un-necessary glfsheal* logs in /var/log/glusterfs/. For example, we can now run `gluster volume heal <VOLNAME> info --nolog` `gluster volume heal <VOLNAME> info split-brain --nolog` etc. The default log level is still retained at GF_LOG_INFO. The patch also changes glfsheal internally to accept '--xml' instead of 'xml'. Note: The --nolog flag is *not* displayed in the help anywhere, for the sake of consistency in how the other flags are not displayed anywhere in the help. fixes: bz#1643519 Change-Id: Ia08b6aa6e4a0548379db7e313dd4411ebc66f206 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* cluster/afr: Add test for thin-arbiter featureAshish Pandey2018-11-261-0/+51
| | | | | | | | | Test : Check success/failure of write fop while different bricks/ta process are down. Change-Id: I3c376935df93ebf1f794c964bd19bc1280d91c59 updates: bz#1624332 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
* coding-standard: memset before string functions similar to sprintf/snprintf etcSusant Palai2018-11-261-0/+31
| | | | | | | | | | | | | String functions like sprintf/snprintf/vprintf etc terminates the string with a null character. This makes meset redundant and also incurs some performance penalty. Also added a comment about using GF_MALLOC instead of GF_CALLOC for allocating buffer for strings, targeted by such functions. Fixes: bz#1193929 Change-Id: I4f40d4fd5342b70983936119606c6c9f352c303c Signed-off-by: Susant Palai <spalai@redhat.com>
* geo-rep: add no-verify and ssh-port options for create commandroot2018-11-261-1/+3
| | | | | | | | Added the missing options and their description. fixes: bz#1652911 Change-Id: Id9135953bc6d32e645f004e1c77449899ca3d67c Signed-off-by: root <Shwetha Acharya>
* libglusterfs: fix memory corruption caused by per-thread mem poolsXavi Hernandez2018-11-261-57/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a race in the per-thread memory pool management that could lead to memory corruption. The race appeared when the following sequence of events happened: 1. Thread T1 allocated a memory object O1 from its own private pool P1 2. T1 terminates and P1 is marked to be destroyed 3. The mem-sweeper thread is woken up and scans all private pools 4. It detects that P1 needs to be destroyed and starts releasing the objects from hot and cold lists. 5. Thread T2 releases O1 6. O1 is added to the hot list of P1 The problem happens because steps 4 and 6 are protected by diferent locks, so they can run concurrently. This means that both T1 and T2 are modifying the same list at the same time, potentially causing corruption. This patch fixes the problem using the following approach: 1. When an object is released, it's only returned to the hot list of the corresponding memory pool if it's not marked to be destroyed. Otherwise the memory is released to the system. 2. Object release and mem-sweeper thread synchronize access to the deletion mark of the memory pool to prevent simultaneous access to the list. Some other minor adjustments are made to reduce the lengths of the locked regions. Fixes: bz#1651165 Change-Id: I63be3893f92096e57f54a6150e0461340084ddde Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* geo-rep: Fix permissions with non-root setupKotresh HR2018-11-261-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: In non-root fail-over/fail-back(FO/FB), when slave is promoted as master, the session goes to 'Faulty' Cause: The command 'gluster-mountbroker <mountbroker-root> <group>' is run as a pre-requisite on slave in non-root setup. It modifies the permission and group of following required directories and files recursively [1] /var/lib/glusterd/geo-replication [2] /var/log/glusterfs/geo-replication-slaves In a normal setup, this is executed on slave node and hence doing it recursively is not an issue on [1]. But when original master becomes slave in non-root during FO/FB, it contains ssh public keys and modifying permissions on them causes geo-rep to fail with incorrect permissions. Fix: Don't do permission change recursively. Fix permissions for required files. fixes: bz#1651498 Change-Id: I68a744644842e3b00abc26c95c06f123aa78361d Signed-off-by: Kotresh HR <khiremat@redhat.com>
* gfapi: Offload callback notifications to synctaskSoumya Koduri2018-11-264-10/+419
| | | | | | | | | | | | | | | | | | | | | | Upcall notifications are received from server via epoll and same thread is used to forward these notifications to the application. This may lead to deadlock and hang in the following scenario. Consider if as part of handling these callbacks, application has to do some operations which involve sending I/Os to gfapi stack which inturn have to wait for epoll threads to receive repsonse. Thus this may lead to deadlock if all the epoll threads are waiting to complete these callback notifications. To address it, instead of using epoll thread itself, make use of synctask to send those notificaitons to the application. Change-Id: If614e0d09246e4279b9d1f40d883a32a39c8fd90 updates: bz#1648768 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
* coverity: Fix coverity issuesMohammed Rafi KC2018-11-264-3/+14
| | | | | | | | | | | | | | | | This patch fixes coverity CID : 1356537 https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389108&defectInstanceId=26791927&mergedDefectId=1356537 CID : 1395666 https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389187&defectInstanceId=26791932&mergedDefectId=1395666 CID : 1351707 https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389027&defectInstanceId=26791973&mergedDefectId=1351707 CID : 1396910 https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389027&defectInstanceId=26791973&mergedDefectId=13596910 Change-Id: I8094981a741f4d61b083c05a98df23dcf5b022a2 updates: bz#789278 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
* glusterd: make max-bricks-per-process default value to 250Atin Mukherjee2018-11-251-1/+1
| | | | | | Change-Id: Ia2c6a10e2b76a4aa8bd4ea97e5ce33bdc813942e Fixes: bz#1652118 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* glusterd: volume status should not show NFS daemonSanju Rakonde2018-11-251-0/+5
| | | | | | | | | With commit 8ad159b2a7, bz#1511339 got reintroduced. fixes: bz#1511339 Change-Id: I1e34c1fc60c6dda04af25d123f1ca40964cadb7a Signed-off-by: Sanju Rakonde <srakonde@redhat.com>