summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
Commit message (Collapse)AuthorAgeFilesLines
* glusterd: additional log informationnik-redhat2020-06-291-7/+48
| | | | | | | | | | | | | | | Issue: Some of the functions didn't had sufficient logging of information in case of failure. Fix: Added log information in few functions in case of failure indicating the cause of such event. Change-Id: I301cf3a1c8d2c94505c6ae0d83072b0241c36d84 fixes: #874 Signed-off-by: nik-redhat <nladha@redhat.com>
* multiple xlators: reduce key lengthYaniv Kaul2020-01-141-5/+6
| | | | | | | | | | | | | | | In many cases, we were freely allocating long keys with no need. Smaller char arrays are just fine almost anywhere, so just went ahead and looked where they we can use smaller ones. In some cases, annotated the functions as static and the prefixes passed as const as it was easier to read and understand. Where relevant, converted the dict functions to use known key length. Change-Id: I882ab33ea20d90b63278336cd1370c09ffdab7f2 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* glusterd: create separate logdirs for cluster.rc instancesN Balachandran2019-08-141-34/+38
| | | | | | | | | | Create a separate logdir for each host instance created by cluster.rc. This makes it easier to determine the files belonging to a particular instance. Change-Id: Ic8321f83f98995412b7d5f095b3d3f0391767a8b Fixes: bz#1733042 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* core: use more restrictive mode while creating the directoriesSanju Rakonde2019-07-231-2/+2
| | | | | | | fixes: bz#1724024 Change-Id: I539fb7248b2cfc037ec29f1413ea648f9ec21ef2 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* Replace usleep() with nanosleep()Vijay Bellur2019-07-111-2/+2
| | | | | | | | | | | | | | | | | | | As usleep has been obsoleted, changed all invocations of usleep to nanosleep. From man 3 usleep: "4.3BSD, POSIX.1-2001. POSIX.1-2001 declares this function obsolete; use nanosleep(2) instead. POSIX.1-2008 removes the specification of usleep()." Added a helper function gf_nanosleep() to have a single place for handling edge cases that might arise from the conversion of usleep to nanosleep and allow the sleep to resume with right remaining value upon being interrupted. Fixes: bz#1721686 Change-Id: Ia39ab82c9e0f4669d2c00d4cdf25e38d94ef9f62 Signed-off-by: Vijay Bellur <vbellur@redhat.com>
* clang-scan: resolve warningAmar Tumballi2019-06-151-0/+6
| | | | | | | | | | | | | | | dht-common.c: because there was a 'goto err' before assigning the 'local' variable, there is possibility of NULL dereference. As the check which was done wouldn't ever be true, removed the check. glusterd-geo-rep.c: a possible path where 'slave_host' could be NULL when it gets passed to strcmp() is found. strcmp() expects a valid string. Add a NULL check. Updates: bz#1622665 Change-Id: I64c280bc1beac9a2b109e8fa88f2a5ce8b823c3a Signed-off-by: Amar Tumballi <amarts@redhat.com>
* Fix some "Null pointer dereference" coverity issuesXavi Hernandez2019-05-261-2/+5
| | | | | | | | | | | | | | | | | | | | | | This patch fixes the following CID's: * 1124829 * 1274075 * 1274083 * 1274128 * 1274135 * 1274141 * 1274143 * 1274197 * 1274205 * 1274210 * 1274211 * 1288801 * 1398629 Change-Id: Ia7c86cfab3245b20777ffa296e1a59748040f558 Updates: bz#789278 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* glusterd: Fix coverity defects & put coverity annotationsAtin Mukherjee2019-05-021-1/+2
| | | | | | | | | | | Along with fixing few defect, put the required annotations for the defects which are marked ignore/false positive/intentional as per the coverity defect sheet. This should avoid the per component graph showing many defects as open in the coverity glusterfs web page. Updates: bz#789278 Change-Id: I19461dc3603a3bd8f88866a1ab3db43d783af8e4 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* glusterd: remove redundant glusterd_check_volume_exists () callsAtin Mukherjee2019-04-081-19/+5
| | | | | | | | | | | | | | | | | | A pattern of following was found in multiple places where both glusterd_check_volume_exists and glusterd_volinfo_find do the same job. We just need one of them not both. In a scaled environment having many volumes this is a bottleneck to iterate over the volume list to find a volume twice! exists = glusterd_check_volume_exists(volname); ret = glusterd_volinfo_find(volname, &volinfo); if ((ret) || (!exists)) { Credits: ykaul@redhat.com for finding this out Updates: bz#1193929 Change-Id: Ie116fe5c93e261a2bddd267c28ccb20a2884a36f Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* geo-rep: IPv6 supportAravinda VK2019-03-151-2/+28
| | | | | | | | | | | | | `address_family=inet6` needs to be added while mounting master and slave volumes in gverify script. New option introduced to gluster cli(`--inet6`) which will be used internally by geo-rep while calling `gluster volume info --remote-host=<ipv6>`. Fixes: bz#1688833 Change-Id: I1e0d42cae07158df043e64a2f991882d8c897837 Signed-off-by: Aravinda VK <avishwan@redhat.com>
* all: handle string-overflow warnings of coverityAmar Tumballi2018-12-201-28/+45
| | | | | | updates: bz#789278 Change-Id: I7de800b90a614e3666e965b0cafc70026a844b2d Signed-off-by: Amar Tumballi <amarts@redhat.com>
* libglusterfs: Move devel headers under glusterfs directoryShyamsundarR2018-12-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | libglusterfs devel package headers are referenced in code using include semantics for a program, this while it works can be better especially when dealing with out of tree xlator builds or in general out of tree devel package usage. Towards this, the following changes are done, - moved all devel headers under a glusterfs directory - Included these headers using system header notation <> in all code outside of libglusterfs - Included these headers using own program notation "" within libglusterfs This change although big, is just moving around the headers and making it correct when including these headers from other sources. This helps us correctly include libglusterfs includes without namespace conflicts. Change-Id: Id2a98854e671a7ee5d73be44da5ba1a74252423b Updates: bz#1193929 Signed-off-by: ShyamsundarR <srangana@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>
* 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>
* geo-rep : fix coverity issues in glusterd-geo-rep.cSunny Kumar2018-09-201-7/+10
| | | | | | | | | | | | | | | | | This patch fixes CID 1210979, 1214614, 1292650, 1357874, 1382404. 1. overflowed or a truncated value : call to sys_read has been reduced to 'sizeof(buf) -1' and after operation buf is properly terminated. 2. tainted_data_argument : truncation due to cast operation on operand : resulted form call to strtol: chaged data type from pid_t to long. 3. tainted_data_argument : call to fgets is reduced by 2 to make space for the '\n' and '\0'. updates: bz#789278 Change-Id: Ib883501205c85007771213071c8e182286eb0bc0 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* geo-rep: Fix issues related config setKotresh HR2018-09-181-2/+3
| | | | | | | | | | | | | | | | | | | | 1. '--ignore-mising-args' option for rsync is not being used even though the rsync version is greater than 3.1.0. Fixed the same. 2. '--existing' option for rsync is also not being used. Fixed the same. 3. geo-rep config fails to set rsync-options as the value contains '--'. Interestingly, python argsparse treats the value with '--' (e.g., --ignore-missing-args) as option. But when passed with something like --value=--ignore-missing-args, it succeeds. Fixed the same. Change-Id: Iaeb838acaff1c2920fee9c7f920c99edce13a0a1 Signed-off-by: Kotresh HR <khiremat@redhat.com> fixes: bz#1629561
* glusterd: NULL pointer dereferencing clang FixHarpreet Lalwani2018-09-171-1/+1
| | | | | | | | | Added ternary operator to avoid NULL pointer dereferencing Updates: bz#1622665 Change-Id: I855f6caf720b28af1564898d75c6c965bcc58c5c Signed-off-by: Harpreet Lalwani <hlalwani@redhat.com>
* Land part 2 of clang-format changesGluster Ant2018-09-121-5788/+5768
| | | | | Change-Id: Ia84cc24c8924e6d22d02ac15f611c10e26db99b4 Signed-off-by: Nigel Babu <nigelb@redhat.com>
* glusterd: NULL pointer dereferencing clang fixSheetal Pamecha2018-09-111-1/+2
| | | | | | | | | Added ternary operator to avoid NULL pointer dereferencing Updates: bz#1622665 Change-Id: I4b970176b6b555c2eda1da2848c493e45b1e4217 Signed-off-by: Sheetal Pamecha <sheetal.pamecha08@gmail.com>
* multiple xlators (mgmt): strncpy()->sprintf(), reduce strlen()'sYaniv Kaul2018-09-071-25/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | xlators/mgmt/glusterd/src/glusterd-geo-rep.c xlators/mgmt/glusterd/src/glusterd-handshake.c xlators/mgmt/glusterd/src/glusterd-sm.c xlators/mgmt/glusterd/src/glusterd-store.c xlators/mgmt/glusterd/src/glusterd-utils.c xlators/mgmt/glusterd/src/glusterd-volgen.c xlators/mgmt/glusterd/src/glusterd-volume-ops.c xlators/mgmt/glusterd/src/glusterd.c strncpy may not be very efficient for short strings copied into a large buffer: If the length of src is less than n, strncpy() writes additional null bytes to dest to ensure that a total of n bytes are written. Instead, use snprintf(). Try to ensure output is not truncated. Also: - save the result of strlen() and re-use it when possible. - move from strlen to SLEN (sizeof() ) for const strings. Compile-tested only! Change-Id: Ib5d001857236f43e41c4a51b5f48e1a33110aaeb updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* {dht-rebalance|glusterd-geo-rep|glusterd-utils|nfs|bd}.c: no dict_del before ↵Yaniv Kaul2018-09-041-3/+0
| | | | | | | | | | | | dict_set There is no need to remove an item before re-setting it. Compile-tested only! Change-Id: I2869aec9ebf474859127b8b38d284246e6097e84 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* geo-rep : fix coverity issues in glusterd-geo-rep.cSunny Kumar2018-09-041-3/+40
| | | | | | | | | | | | | | This patch fixes RESOURCE_LEAK at line number 1344, 2088, 4819, 1347, 2092, 1608, 1612, 2284, 3837. It also fixes FORWARD_NULL at line number 2955. CID : 1175012, 1175014, 1210989, 1223042, 1223043, 1382381, 1382429, 1389120, 1389474, 1390452, 1356512. Change-Id: I7de239944eb61073d208ecf3899999a1ea0c8e43 updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* multiple files: remove unndeeded memset()Yaniv Kaul2018-08-291-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a squash of multiple commits: contrib/fuse-lib/misc.c: remove unneeded memset() All flock variables are properly set, no need to memset it. Only compile-tested! Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I8e0512c5a88daadb0e587f545fdb9b32ca8858a2 libglusterfs/src/{client_t|fd|inode|stack}.c: remove some memset() I don't think there's a need for any of them. Only compile-tested! Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I2be9ccc3a5cb5da51a92af73488cdabd1c527f59 libglusterfs/src/xlator.c: remove unneeded memset() All xl->mem_acct members are properly set, no need to memset it. Only compile-tested! Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I7f264cd47e7a06255a3f3943c583de77ae8e3147 xlators/cluster/afr/src/afr-self-heal-common.c: remove unneeded memset() Since we are going over the whole array anyway, initialize it properly, to either 1 or 0. Only compile-tested! Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: Ied4210388976b6a7a2e91cc3de334534d6fef201 xlators/cluster/dht/src/dht-common.c: remove unneeded memset() Since we are going over the whole array anyway it is initialized properly. Only compile-tested! Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: Idc436d2bd0563b6582908d7cbebf9dbc66a42c9a xlators/cluster/ec/src/ec-helpers.c: remove unneeded memset() Since we are going over the whole array anyway it is initialized properly. Only compile-tested! Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I81bf971f7fcecb4599e807d37f426f55711978fa xlators/mgmt/glusterd/src/glusterd-volgen.c: remove some memset() I don't think there's a need for any of them. Only compile-tested! Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I476ea59ba53546b5153c269692cd5383da81ce2d xlators/mgmt/glusterd/src/glusterd-geo-rep.c: read() in 4K blocks The current 1K seems small. 4K is usually better (in Linux). Also remove a memset() that I don't think is needed between reads. Only compile-tested! Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I5fb7950c92d282948376db14919ad12e589eac2b xlators/storage/posix/src/posix-{gfid-path|inode-fd-ops}.c: remove memset() before sys_*xattr() functions. I don't see a reason to memset the array sent to the functions sys_llistxattr(), sys_lgetxattr(), sys_lgetxattr(), sys_flistxattr(), sys_fgetxattr(). (Note: it's unclear to me why we are calling sys_*txattr() functions with XATTR_VAL_BUF_SIZE-1 size instead of XATTR_VAL_BUF_SIZE ). Only compile-tested! Change-Id: Ief2103b56ba6c71e40ed343a93684eef6b771346 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* xlators/mgmt/glusterd/src/glusterd-geo-rep.c : reduce size of message variableYaniv Kaul2018-08-231-3/+3
| | | | | | | | | | Size of error message variable reduced from 2048 bytes to 64 bytes. Compile-tested only! Change-Id: I65abd9c4f23a64ac9cda5373aff4119458addbc8 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* All: remove memset() before sprintf()Yaniv Kaul2018-08-141-2/+0
| | | | | | | | | | | | It's not needed. There's a good chance the compiler is smart enough to remove it anyway, but it can't hurt - I hope. Compile-tested only! Change-Id: Id7c054e146ba630227affa591007803f3046416b updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* geo-rep : fix possible crashSunny Kumar2018-07-231-2/+5
| | | | | | | | | | | | Problem : In 'glusterd_verify_slave' while tokenizing error message we call 'strtok_r' and store return value in 'tmp' which can be NULL. We are passing this 'tmp' as 1st argument to 'strcmp' which will lead to segmentation fault. Solution : before calling 'strcmp' we should NULL check 'tmp'. Change-Id: Ifd3864b904afe6cd09d9e5a4b55c6d0578e22b9d fixes: bz#1602121 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* All: run codespell on the code and fix issues.Yaniv Kaul2018-07-221-1/+1
| | | | | | | | | | | | Please review, it's not always just the comments that were fixed. I've had to revert of course all calls to creat() that were changed to create() ... Only compile-tested! Change-Id: I7d02e82d9766e272a7fd9cc68e51901d69e5aab5 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* Fix compile warningsXavi Hernandez2018-07-101-74/+181
| | | | | | | | | | | This patch fixes compile warnings that appear with newer compilers. The solution applied is only to remove the warnings, but it doesn't always solve the problem in the best way. It assumes that the problem will never happen, as the previous code assumed. Change-Id: I6e8470d6c2e2dbd3bd7d324b5fd2f92ffdc3d6ec updates: bz#1193929 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* glusterd: memory leak in geo-rep statusSanju Rakonde2018-05-281-2/+6
| | | | | | | Fixes: bz#1580352 Change-Id: I9648e73090f5a2edbac663a6fb49acdb702cdc49 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* glusterd/geo-rep: Fix glusterd crashKotresh HR2018-05-121-1/+1
| | | | | | | | | | | | Using strdump instead of gf_strdup crashes during free if mempool is being used. gf_free checks the magic number in the header which will not be taken care if strdup is used. fixes: bz#1576392 Change-Id: Iab36496554b838a036af9d863e3f5fd07fd9780e Signed-off-by: Kotresh HR <khiremat@redhat.com>
* glusterd/geo-rep: Fix UNUSED_VALUE coverity issueVarsha Rao2018-05-031-8/+6
| | | | | | | | | | | The return value of glusterd_get_local_brickpaths is unused so add goto statement. As it is reinitialized outside the if block. Also change the if condition to check the failure case, when return value is -1 and path_list is NULL. Change-Id: I6b47d7751263f704bd69a6452a7e71bfcf226d49 updates: bz#789278 Signed-off-by: Varsha Rao <varao@redhat.com>
* georep : Pause/Resume of geo-replication with wrong userSunny Kumar2018-03-201-0/+23
| | | | | | | | | | | While performing pause/resume on geo-replication with wrong user (other user then you setup), always returns success. Which further leads to snapshot creation failure as it is detecting active geo-replication session. Change-Id: I6e96e8dd3e861348b057475387f0093cb903ae88 BUG: 1550936 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* tests: Enable geo-rep test casesKotresh HR2018-01-051-3/+7
| | | | | | | | | | | | | | | | | This patch re-enables the geo-rep test cases. Along with it does following optimizations. 1. Use EXPECT_WITHIN instead of sleep 2. Clean up geo-rep ssh key after test 3. Changes to gverify.sh and S56glusterd-geo-rep-create-post.sh to use the given ssh identity file for geo-rep create 4. Make gluster-command-dir configurable and introduce slave-gluster-command-dir which points the parent directory of gluster binaries in master and slave respectively. Change-Id: Ia7696278d9dd3ba04224dcd7c3564088ca970b04 BUG: 1480491 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* glusterd:buffer_size_warning coverity fixesSubha sree Mohankumar2017-12-021-0/+6
| | | | | | | | Fixes Issues :15,17,18,19,24,38 Change-Id: Ib09d319308e4ef7dfbdd5e49e16064d4f55a54f9 BUG: 789278 Signed-off-by: Subha sree Mohankumar <smohanku@redhat.com>
* glusterd: spelling errors reported by Debian maintainerKaleb S. KEITHLEY2017-09-041-1/+1
| | | | | | | | | | | | Reported-by: "Patrick Matthäi" <pmatthaei@debian.org> Change-Id: I0dd6b7d88ddf3c98e8083b75f8dd848babcfd30a BUG: 1487840 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: https://review.gluster.org/18185 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
* glusterd: Add geo-replication session details to get-state outputSamikshan Bairagya2017-08-041-1/+1
| | | | | | | | | | | | | | | This commit adds support to the get-state CLI to capture details on geo-replication session as obtained in `gluster volume geo-replication status detail` in its output. Fixes: #291 Change-Id: I2fbcba70bfdaf439522637234805545194777ed4 Signed-off-by: Samikshan Bairagya <samikshan@gmail.com> Reviewed-on: https://review.gluster.org/17941 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shubhendu Tripathi <shtripat@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
* geo-rep: Separate slave mount logs for each connectionKotresh HR2017-01-181-3/+3
| | | | | | | | | | | | | | | | | | | | | Geo-rep worker mounts the slave volume on the slave node. If multiple worker connects to same slave node, all workers share the same mount log file. This is very difficult to debug as logs are cluttered from different mounts. Hence creating separate mount log file for each connection from worker. Each connection from worker is identified uniquely using 'mastervol uuid', 'master host', 'master brickpath', 'salve vol'. The log file name will be combination of the above. Change-Id: I67871dc8e8ea5864e2ad55e2a82063be0138bf0c BUG: 1412689 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/16384 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Aravinda VK <avishwan@redhat.com>
* glusterd/geo-rep: Fix geo-rep config issueKotresh HR2016-12-261-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Geo-replication config commands fail when geo-rep status is in 'Created'. Cause: During staging phase of geo-rep config, it checks for the existence of 'monitor.pid' file. But the pid file gets created only on start of geo-rep. Hence it fails. Fix: Do not check for the existence of pid-file during staging for config commands. It is not required. Change-Id: I626d368b249cf0423c7f49b4284465508371f566 BUG: 1404678 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/16132 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Aravinda VK <avishwan@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
* glusterd/geo-rep: Fix glusterd crashKotresh HR2016-12-081-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: glusterd crashes when geo-rep mountbroker setup is created if the slave user length is more than 8 characters. Cause: _POSIX_LOGIN_NAME_MAX is used which is 9 including NULL byte. Analysis: While the man page says it sufficient for portability, but acutally it's not. Linux allows the creation of username upto 32 characters by default where the max length is 256. And NetBSD's max is 17. Linux: #getconf LOGIN_NAME_MAX 256 NetBSD: #getconf LOGIN_NAME_MAX 17 Fix: Use LOGIN_NAME_MAX instead of _POSIX_LOGIN_NAME_MAX Change-Id: I26b7230433ecbbed6e6914ed39221a478c0266a8 BUG: 1368138 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/16053 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Aravinda VK <avishwan@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
* geo-rep: Do not restart workers when log-rsync-performance config changeAravinda VK2016-12-071-0/+2
| | | | | | | | | | | | | | | | | | Geo-rep restarts workers when any of the configurations changed. We don't need to restart workers if tunables like log-rsync-performance is modified. With this patch, Geo-rep workers will get new "log-rsync-performance" config automatically without restart. BUG: 1393678 Change-Id: I40ec253892ea7e70c727fa5d3c540a11e891897b Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/15816 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Kotresh HR <khiremat@redhat.com>
* glusterd (geo-rep): fix unused variable warnings/errorsKaleb S. KEITHLEY2016-09-121-18/+4
| | | | | | | | | | | | | | | | | http://review.gluster.org/14085 fixes a/the "leak" - via the generated rpc/xdr headers - of pragmas that mask these warnings. However 14085 won't pass the smoke test until all the warnings are fixed. Change-Id: I2edacd3d0f3924b1be0f0398ba9ac076459c5a61 BUG: 1369124 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/15263 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Saravanakumar Arumugam <sarumuga@redhat.com>
* dict: Don't expose get_new_dict/dict_destroyPranith Kumar K2016-07-251-2/+2
| | | | | | | | | | | | | | | get_new_dict/dict_destroy is causing confusion where, dict_new/dict_destroy or get_new_dict/dict_unref are used instead of dict_new/dict_unref. Change-Id: I4cc69f5b6711d720823395e20fd624a0c6c1168c BUG: 1296043 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/13183 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
* glusterd/geo-rep: fix memory leak and minor fixesSaravanakumar Arumugam2016-07-201-11/+20
| | | | | | | | | | | | | | Fix for memory leak and other issues revealed by coverity. Change-Id: Ib66eaa3a1a086d4b487534cebc56af5e1f9bf576 BUG: 1356528 Signed-off-by: Saravanakumar Arumugam <sarumuga@redhat.com> Reviewed-on: http://review.gluster.org/14925 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* glusterd/geo-rep: Handle empty monitor.status during upgradeSaravanakumar Arumugam2016-07-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Consider geo-replication is in Stopped state. Following which, glusterfs is upgraded (where monitor.status is the new status file). Now, When geo-replication status command is run, empty monitor status file gets created. Now, if glusterd is restarted, it reads empty monitor status and starts geo-replication session. This is incorrect as session was in Stopped state earlier. Solution: If monitor status is empty, error out and avoid starting geo-replication session. Note: if monitor status is empty, geo-rep session is displayed as Stopped state. Change-Id: Ifb3db896e5ed92b927764cf1163503765cb08bb4 BUG: 1351071 Signed-off-by: Saravanakumar Arumugam <sarumuga@redhat.com> Reviewed-on: http://review.gluster.org/14830 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* georep: add reset-sync-time option for session deleteMilind Changire2016-06-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Set the stime xattr at all the brick roots to (0,0) if the argument reset-sync-time has been provided on the command-line. To avoid testing against directory specific stime, the remote stime is assumed to be minus_infinity, if the root directory stime is set to (0,0), before the directory scan begins. This triggers a full volume resync to slave in the case of a geo-rep session recreation with the same master-slave volume pair. Command synopsis: gluster volume geo-replication <MASTERVOL> <SLAVE>::<SLAVEVOL> delete \ [reset-sync-time] Update gluster cli man page to include new sub-command reset-sync-time. Change-Id: Ie4ce03b9425ed9bb81eda8681058c0fc6f990948 BUG: 1311926 Signed-off-by: Milind Changire <mchangir@redhat.com> Reviewed-on: http://review.gluster.org/14051 Reviewed-by: Kotresh HR <khiremat@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Aravinda VK <avishwan@redhat.com>
* glusterd/geo-rep: Add relative path validation to copy file commandAravinda VK2016-06-271-0/+34
| | | | | | | | | | | | | | Added validation for input file, command fails if input file path is relative path pointing outside of GLUSTERD_WORKDIR. BUG: 1348897 Change-Id: I329d43ebed69bfe9fe03d6be70dc8c78a605ffc5 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/14772 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* glusterd: unsafe strcat, strncat use in glusterd_op_stage_gsync_create()Kaleb S KEITHLEY2016-06-161-19/+13
| | | | | | | | | | | | | | SuSE build system post-compile analysis aborts pkg build due to unsafe strcat, strncat usage. Change-Id: I52ac41e1172d0c1e5695a91b9f731cc9e7de4db4 BUG: 1347354 Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/14745 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* glusterd/geo-rep: remove unused variablesSaravanakumar Arumugam2016-06-141-6/+1
| | | | | | | | | | | | | | cleanup - remove unused variables, fix return value. Change-Id: I77b663bdae0ffe7667486f5f4e2355ef9757f960 BUG: 1346211 Signed-off-by: Saravanakumar Arumugam <sarumuga@redhat.com> Reviewed-on: http://review.gluster.org/14728 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
* glusterd/geo-rep: Avoid started status check if same hostSaravanakumar Arumugam2016-06-101-26/+65
| | | | | | | | | | | | | | | | | | | After carrying out add-brick, session creation is carried out again, to involve new brick in the session. This needs to be done, even if the session is in Started state. While involving slave uuid as part of a session, User is warned if session is in Started state. This check needs to be avoided if it is same slave host and session creation needs to be proceeded. Change-Id: Ic73edd5bd9e3ee55da96f5aceec0bafa14d3f3dd BUG: 1342979 Signed-off-by: Saravanakumar Arumugam <sarumuga@redhat.com> Reviewed-on: http://review.gluster.org/14653 CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Aravinda VK <avishwan@redhat.com>
* glusterd/geo-rep: upgrade path when slave vol uuid involvedSaravanakumar Arumugam2016-06-031-10/+189
| | | | | | | | | | | | | | | | | | slave volume uuid is involved in identifying a geo-replication session. This patch addresses upgrade path, where existing geo-rep session is gracefully upgraded to involve slave volume uuid. Change-Id: Ib7ff5109b161592f24fc86fc7e93a407655fab86 BUG: 1337473 Signed-off-by: Saravanakumar Arumugam <sarumuga@redhat.com> Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/14425 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Smoke: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Aravinda VK <avishwan@redhat.com>