summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
Commit message (Collapse)AuthorAgeFilesLines
...
* core: create a constant for default network timeoutXavi Hernandez2018-11-231-2/+0
| | | | | | | | | | A new constant named GF_NETWORK_TIMEOUT has been defined and all references to the hard-coded timeout of 42 seconds have been replaced with this constant. Change-Id: Id30f5ce4f1230f9288d9e300538624bcf1a6da27 fixes: bz#1652852 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* core: Resolve memory leak at the time of graph initMohit Agrawal2018-11-201-4/+0
| | | | | | | | | | | Problem: Memory leak when graph init fails as during volfile exchange between brick and glusterd Solution: Fix the error code path in glusterfs_graph_init Change-Id: If62bee61283fccb7fd60abc6ea217cfac12358fa fixes: bz#1651431 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* core: Retrieving the value of "client.ssl" option, before SSL is set up, failsSheetal Pamecha2018-11-201-0/+2
| | | | | | | | Added a default value "off" for (client|server).ssl fixes: bz#1651059 Change-Id: I3d9c80093ac471d9d770fbd6c67f945491cf726e Signed-off-by: Sheetal Pamecha <sheetal.pamecha08@gmail.com>
* core: fix strncpy, coverity annotationKaleb S. KEITHLEY2018-11-191-1/+6
| | | | | | | | | | | | For added fun, coverity is not smart enough to detect that the strncpy() is safe, and for extra laughs, using coverity annotations doesn't do anything either; but we're adding them anyway, along with marking the BUFFER_SIZE_WARNINGS as false positives on scan.coverity.com. Change-Id: If7fa157eca565842109f32fee0399ac183b19ec7 updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* glusterd/mux: Optimize brick disconnect handler codeMohammed Rafi KC2018-11-184-140/+85
| | | | | | | | | Removed unnecessary iteration during brick disconnect handler when multiplex is enabled. Change-Id: I62dd3337b7e7da085da5d76aaae206e0b0edff9f fixes: bz#1650115 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
* glusterd: fix Resource leak coverity issueMohit Agrawal2018-11-161-2/+10
| | | | | | | | | | | | Problem: In commit bcf1e8b07491b48c5372924dbbbad5b8391c6d81 code was missed to free path return by function search_brick_path_from_proc This patch fixes CID: 1396668: Resource leak Change-Id: I4888c071c1058023c7e138a8bcb94ec97305fadf fixes: bz#1646892 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* cli: cluster.server-quorum-type help text is missingShwetha Acharya2018-11-161-4/+8
| | | | | | | | Added a default value "none" and additional description. Change-Id: I3a5c06f8ec1e502fc399860e4b5cb835102cd71d Updates: bz#1608512 Signed-off-by: Shwetha Acharya <sacharya@redhat.com>
* core: fix strncpy warningsKaleb S. KEITHLE2018-11-156-42/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since gcc-8.2.x (fedora-28 or so) gcc has been emitting warnings about buggy use of strncpy. Most uses that gcc warns about in our sources are exactly backwards; the 'limit' or len is the strlen/size of the _source param_, giving exactly zero protection against overruns. (Which was, after all, one of the points of using strncpy in the first place.) IOW, many warnings are about uses that look approximately like this: ... char dest[8]; char src[] = "this is a string longer than eight chars"; ... strncpy (dest, src, sizeof(src)); /* boom */ ... The len/limit should be sizeof(dest). Note: the above example has a definite over-run. In our source the overrun is typically only theoretical (but possibly exploitable.) Also strncpy doesn't null-terminate on truncation; snprintf does; prefer snprintf over strncpy. Mildly surprising that coverity doesn't warn/isn't warning about this. Change-Id: I022d5c6346a751e181ad44d9a099531c1172626e updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLE <kkeithle@redhat.com>
* core: fix strncpy warningsKaleb S. KEITHLE2018-11-151-5/+5
| | | | | | | | | | | | | | | | | | | Since gcc-8.2.x (fedora-28 or so) gcc has been emitting warnings about buggy use of strncpy. e.g. warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length and warning: ‘strncpy’ specified bound depends on the length of the source argument Since we're copying string fragments and explicitly null terminating use memcpy to silence the warning Change-Id: I413d84b5f4157f15c99e9af3e154ce594d5bcdc1 updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
* glusterd/snapshot: copy-paste typoSanju Rakonde2018-11-131-1/+1
| | | | | | Change-Id: Ice3663084b2d0a0a10d75ad68fe5fe494f928250 updates: bz#1193929 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* glusterfsd: Make each multiplexed brick sign inPrashanth Pai2018-11-121-1/+11
| | | | | | | | | | | | | | | | | | | | | | | NOTE: This change will be consumed by brick mux implementation of glusterd2 only. No corresponsing change in glusterd1 has been made. When a multiplexed brick process is shutting down, it sends sign out requests to glusterd for all bricks that it contains. However, sign in request is only sent for a single brick. Consequently, glusterd has to use some tricky means to repopulate pmap registry with information of multiplexed bricks during glusterd restart. This change makes each multiplexed brick send a sign in request to glusterd2 which ensures that glusterd2 can easily repopulate pmap registry with port information. As a bonus, sign in request will now also contain PID of the brick sending the request so that glusterd2 can rely on this instead of having to read/manage brick pidfiles. Change-Id: I409501515bd9a28ee7a960faca080e97cabe5858 updates: bz#1193929 Signed-off-by: Prashanth Pai <ppai@redhat.com>
* glusterd: don't call svcs_reconfigure for all volumes during op-version bump upAtin Mukherjee2018-11-121-8/+12
| | | | | | | | | | With having large number of volumes in a configuration having svcs_reconfigure () called for every volumes makes cluster.op-version bump up to time out. Instead call svcs_reconfigure () only once. Change-Id: Ic6a133d77113c992a4dbeaf7f5663b7ffcbb0ae9 Fixes: bz#1648237 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* core: Portmap entries showing stale brick entries when bricks are downMohit Agrawal2018-11-122-2/+7
| | | | | | | | | | | | | | | | Problem: pmap is showing stale brick entries after down the brick because of glusterd_brick_rpc_notify call gf_is_service_running before call pmap_registry_remove to ensure about brick instance. Solutiom: 1) Change the condition in gf_is_pid_running to ensure about process existence, use open instead of access to achieve the same 2) Call search_brick_path_from_proc in __glusterd_brick_rpc_notify along with gf_is_service_running Change-Id: Ia663ac61c01fdee6c12f47c0300cdf93f19b6a19 fixes: bz#1646892 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* ctime: Enable ctime feature by defaultKotresh HR2018-11-112-12/+6
| | | | | | | | | | | | | | | | | | | | This patch does following. 1. Enable ctime feature by default. 2. Earlier, to enable the ctime feature, two options needed to be enabled a. gluster vol set <volname> utime on b. gluster vol set <volname> ctime on This is inconvenient from the usability point of view. Hence changed it to following single option a. gluster vol set <volname> ctime on fixes: bz#1624724 Change-Id: I04af0e5de1ea6126c58a06ba8a26e22f9f06344e Signed-off-by: Kotresh HR <khiremat@redhat.com>
* glusterd: allow shared-storage to use bricks under glusterd working directorySanju Rakonde2018-11-086-11/+15
| | | | | | | | | | | | | | | With commit 44e4db, we are not allowing user to create a volume using glusterd's working directory as a brick or any sub directory under glusterd's working directory as a brick.This has broken shared-storage since the volume "gluster-shared-storage" is created using the bricks under glusterd's working directory. With this patch, we let the "gluster-shared-storage" volume to use bricks under glusterd's working directory. fixes: bz#1647029 Change-Id: Ifcbcf4576eea12cf46f199dea287b29bd3ec3bfd Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* bd: remove from the buildAmar Tumballi2018-11-081-3/+0
| | | | | | | | | | | | Based on the proposal to remove few features as they are not actively maintained [1], removed BD (block device) translator from the build. [1] - https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html Updates: bz#1635688 Change-Id: Ia96db406c58a7aef355dde6bc33523bb2492b1a9 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* glusterd: initialise caps inside #ifdef HAVE_BD_XLATOR blockSanju Rakonde2018-11-061-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Note: The problem is seen when we disable bd xlator. Problem: When we create a volume, volume info file is having caps value as 15 in nodes which hosts bricks for that volume. Remainig nodes in cluster are not having caps field. When glusterd is restarted, peers are going into rejected state, because of this mismacth in configuration files. Cause: In glusterd_op_create_volume(), we initialise caps value as 15 in the beginning. Later, we check whether brick belongs to the same node or not. If brick doesn't belong to the same node, caps value will be set to 0. If brick belongs to the same node, we will change the caps value inside Solution: If brick doesn't belongs to the same node,caps is set to 0 and if brick belongs to same brick caps value is changed inside #ifdef HAVE_BD_XLATOR block. So, to have the consistency across the cluster, we need to initialise caps value inside #ifdef HAVE_BD_XLATOR block, only when brick belongs to the same node. fixes: bz#1645986 Change-Id: I2648f420b21d6e69e7c38b0f4736d41e0f15a7f5 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* all: fix the format string exceptionsAmar Tumballi2018-11-053-3/+3
| | | | | | | | | | | | | | | | Currently, there are possibilities in few places, where a user-controlled (like filename, program parameter etc) string can be passed as 'fmt' for printf(), which can lead to segfault, if the user's string contains '%s', '%d' in it. While fixing it, makes sense to make the explicit check for such issues across the codebase, by making the format call properly. Fixes: CVE-2018-14661 Fixes: bz#1644763 Change-Id: Ib547293f2d9eb618594cbff0df3b9c800e88bde4 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* glusterd : fix high sev coverity issueSunny Kumar2018-11-051-1/+4
| | | | | | | | | This patch fixes CID : 1174824 : RESOURCE_LEAK updates: bz#789278 Change-Id: I2a4f8b508995de112fa16e1094e44ecd4b625312 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* glusterd: coverity fixesAtin Mukherjee2018-11-031-6/+8
| | | | | | | | | | | | | Addresses CIDs : 1124769, 1124852, 1124864, 1134024, 1229876, 1382382 Also addressed a spurious failure in tests/bugs/glusterd/df-results-post-replace-brick-operations.t to ensure post replace brick operation and before triggering 'df' from mount, client has connection to the newly replaced bricks. Change-Id: Ie5d7e02f89400a661491d7fc2a120d6f6a83a1cc Updates: bz#789278 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* glusterd : fix high coverity issues glusterd-store.cSunny Kumar2018-11-021-31/+43
| | | | | | | | | | | This patch fixes CID 1224305, 1202395, 1202394, 1174824, 1174825, 1174826 and 1202397. All issues are of RESOURCE_LEAK type. Change-Id: Ie9944d5bdd0bd2788afdb1b6bb329aa3c44b90d0 updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* tiering: remove the translator from build and glusterdAmar Tumballi2018-11-022-798/+0
| | | | | | | | | | | | | Based on the proposal to remove few features as they are not actively maintained [1], removing tier translator from the build. Also make sure there are no regression tests involving tiering feature are present. [1] https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html Change-Id: I2c177f711f9b54b7b24e1a13525ff3132bd9a9c5 updates: bz#1642807 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* glusterd: set fsid while performing replace brickSanju Rakonde2018-11-021-0/+18
| | | | | | | | | | While performing the replace-brick operation, we should set fsid value to the new brick. fixes: bz#1637196 Change-Id: I9e9a4962fc0c2f5dff43e4ac11767814a0c0beaf Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* glusterd-handshake: prevent a buffer overflowAmar Tumballi2018-11-011-0/+7
| | | | | | | | | | | | as key size in xdr can be anything, it can be bigger than the 'NAME_MAX' allowed in the structure, which can allow for service denial attacks. Fixes: CVE-2018-14653 Fixes: bz#1644756 Change-Id: I2dc5e99af27ddf44c12c94b07e51adb8674cce80 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* stripe: remove the translator from build and glusterdAmar Tumballi2018-10-317-335/+4
| | | | | | | | | | | | | | | | Based on the proposal to remove few features as they are not actively maintained [1], removing stripe translator from the build. Also make sure there are no regression tests involving stripe translator. [1] https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html Note that this patch aims at removing the translator from build, and a followup patch is needed to remove the code from repository. Updates: bz#1364707 Change-Id: I235b305338f138e29e9f30cba65bc0dadbebbbd5 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* core: auth.ssl-allow has no option descriptionHarpreet Kaur Lalwani2018-10-301-1/+5
| | | | | | | | Added a description for auth.ssl-allow Change-Id: I50cd7c738007c3d7a1b333dae62dbb5e46a7ee67 fixes: bz#1643349 Signed-off-by: Harpreet Kaur Lalwani <hlalwani@redhat.com>
* glusterd: ensure volinfo->caps is set to correct value.Sanju Rakonde2018-10-251-0/+2
| | | | | | | | | | | | | | | | | With the commit febf5ed4848, during the volume create op, we are setting volinfo->caps to 0, only if any of the bricks belong to the same node and brickinfo->vg[0] is null. Previously, we used to set volinfo->caps to 0, when either brick doesn't belong to the same node or brickinfo->vg[0] is null. With this patch, we set volinfo->caps to 0, when either brick doesn't belong to the same node or brickinfo->vg[0] is null. (as we do earlier without commit febf5ed4848). fixes: bz#1635820 Change-Id: I00a97415786b775fb088ac45566ad52b402f1a49 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* src/glusterd-snapshot-utils.c: dereferencing the snap_vol before freeing itArjun2018-10-241-15/+15
| | | | | | | | The patch fixes CID: 1325520 Change-Id: Ic7d3fac6adabe96d1d44f13b57d6dc67da0476d1 updates: bz#789278 Signed-off-by: Arjun <arjsharm@redhat.com>
* glusterd: set integer instead of stringSanju Rakonde2018-10-242-4/+4
| | | | | | | | | | | | | | 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>
* 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>
* libglusterfs/dict: Add sizeof()-1 variants of dict functionsPranith Kumar K2018-10-153-11/+6
| | | | | | | | | | | One needs to be very careful about giving same key for the key and SLEN(key) arguments in dict_xxxn() functions. Writing macros that would take care of passing the SLEN(key) would help reduce this burden on the developer and reviewer. updates: bz#1193929 Change-Id: I312c479b919826570b47ae2c219c53e2f9b2ddef Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* glusterd/geo-rep: Fix memory corruptionKotresh HR2018-10-121-2/+2
| | | | | | | | | | | | | | | | | | | | Problem and Analysis: The length of canonical format of uuid is 36 but 'GF_UUID_BUF_SIZE 50' was being used everywhere. glusterd/geo-rep code was earlier using strncpy, but recently changes to memcpy with the drive to avoid strncpys. This leads to memory corruption and glusterd is crashing without a core with geo-rep creation with ASAN build. Fix: 'GF_UUID_BUF_SIZE 37' (+ 1 for NULL byte) And change geo-rep to use UUID_CANONICAL_FORM_LEN instead Updates: bz#1633930 Change-Id: Ibd347d542b92e64a96ce06780cda643557233bc7 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* 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>
* all: fix warnings on non 64-bits architecturesXavi Hernandez2018-10-103-4/+6
| | | | | | | | | | 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>
* mgmt/glusterd: use proper path to the volfileRaghavendra Bhat2018-10-042-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Till now, glusterd was generating the volfile path for the snapshot volume's bricks like this. /snaps/<snap name>/<brick volfile> But in reality, the path to the brick volfile for a snapshot volume is /snaps/<snap name>/<snap volume name>/<brick volfile> The above workaround was used to distinguish between a mount command used to mount the snapshot volume, and a brick of the snapshot volume, so that based on what is actually happening, glusterd can return the proper volfile (client volfile for the former and the brick volfile for the latter). But, this was causing problems for snapshot restore when brick multiplexing is enabled. Because, with brick multiplexing, it tries to find the volfile and sends GETSPEC rpc call to glusterd using the 2nd style of path i.e. /snaps/<snap name>/<snap volume name>/<brick volfile> So, when the snapshot brick (which is multiplexed) sends a GETSPEC rpc request to glusterd for obtaining the brick volume file, glusterd was returning the client volume file of the snapshot volume instead of the brick volume file. Change-Id: I28b2dfa5d9b379fe943db92c2fdfea879a6a594e fixes: bz#1635050 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
* glusterd: ignore RPC events when glusterd is shutting downAtin Mukherjee2018-10-041-1/+11
| | | | | | | | | | | | | | | When glusterd receives a SIGTERM while it receives RPC connect/disconnect/destroy events, the thread might lead to a crash while accessing rcu_read_lock () as the clean up thread might have already freed up the resources. This is more observable when glusterd comes up with upgrade mode = on during upgrade process. The solution is to ignore these events if glusterd is already in the middle of cleanup_and_exit (). Fixes: bz#1635593 Change-Id: I12831d31c2f689d4deb038b83b9421bd5cce26d9 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* mgmt/glusterd: NULL pointer dereferencing clang fixIraj Jamali2018-10-031-15/+16
| | | | | | | | | Added checks to avoid NULL pointer dereferencing Updates: bz#1622665 Change-Id: I745c1f3ba4df0e486ce99301843f9f13d01c00e0 Signed-off-by: Iraj Jamali <ijamali@redhat.com>
* mgmt/glusterd: NULL pointer deferencing clang fixIraj Jamali2018-10-026-6/+6
| | | | | | | | | Changed this->name to "glusterd" Updates: bz#1622665 Change-Id: Ic8ce428cefd6a5cecf5547769d8b13f530065c56 Signed-off-by: Iraj Jamali <ijamali@redhat.com>
* glusterd: fix coverity issuesSanju Rakonde2018-10-012-2/+3
| | | | | | | | | | | This patch fixes CID 1274175, 1175018. 1274175: Buffer size warning 1175018: Resource leak Change-Id: Id18960c249447b8dae35de3ad92bc570e62ddb09 updates: bz#789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* glusterd: make sure that brickinfo->uuid is not nullSanju Rakonde2018-09-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: After an upgrade from the version where shared-brick-count option is not present to a version which introduced this option causes issue at the mount point i.e, size of the volume at mount point will be reduced by shared-brick-count value times. Cause: shared-brick-count is equal to the number of bricks that are sharing the file system. gd_set_shared_brick_count() calculates the shared-brick-count value based on uuid of the node and fsid of the brick. https://review.gluster.org/#/c/glusterfs/+/19484 handles setting of fsid properly during an upgrade path. This patch assumed that when the code path is reached, brickinfo->uuid is non-null. But brickinfo->uuid is null for all the bricks, as the uuid is null https://review.gluster.org/#/c/glusterfs/+/19484 couldn't reached the code path to set the fsid for bricks. So, we had fsid as 0 for all bricks, which resulted in gd_set_shared_brick_count() to calculate shared-brick-count in a wrong way. i.e, the logic written in gd_set_shared_brick_count() didn't work as expected since fsid is 0. Solution: Before control reaches the code path written by https://review.gluster.org/#/c/glusterfs/+/19484, adding a check for whether brickinfo->uuid is null and if brickinfo->uuid is having null value, calling glusterd_resolve_brick will set the brickinfo->uuid to a proper value. When we have proper uuid, fsid for the bricks will be set properly and shared-brick-count value will be caluculated correctly. Please take a look at the bug https://bugzilla.redhat.com/show_bug.cgi?id=1632889 for complete RCA Steps followed to test the fix: 1. Created a 2 node cluster, the cluster is running with binary which doesn't have shared-brick-count option 2. Created a 2x(2+1) volume and started it 3. Mouted the volume, checked size of volume using df 4. Upgrade to a version where shared-brick-count is introduced (upgraded the nodes one by one i.e, stop the glusterd, upgrade the node and start the glusterd). 5. after upgrading both the nodes, bumped up the cluster.op-version 6. At mount point, df shows the correct size for volume. fixes: bz#1632889 Change-Id: Ib9f078aafb15e899a01086eae113270657ea916b Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* ctime: Provide noatime optionKotresh HR2018-09-251-0/+8
| | | | | | | | | | | | | | | | | Most of the applications are {c|m}time dependant and very few are atime dependant. So provide noatime option to not update atime when ctime feature is enabled. Also this option has to be enabled with ctime feature to avoid unnecessary self heal. Since AFR/EC reads data from single subvolume, atime is only updated in one subvolume triggering self heal. updates: bz#1593538 Change-Id: I085fb33c882296545345f5df194cde7b6cbc337e Signed-off-by: Kotresh HR <khiremat@redhat.com>
* glusterd: fix coverity issuesSanju Rakonde2018-09-253-21/+11
| | | | | | | | | | | | | | | This patch addreeses CID 1124812, 11248123, 1124833, and 1351706 1. We have a null check after GF_ASSERT. GF_ASSERT does a null check and fails if it is null. So removing the redundant null checks. 2. Added a log message to avoid unused value coverity issue Change-Id: Ib0d6dad8f40474afc8e5e60a531d37247cc8a081 updates: bz#789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* mgmt/glusterd: NULL pointer dereferencing clang fixShwetha Acharya2018-09-251-0/+6
| | | | | | | | Added a condition check to resolve the issue Change-Id: I1954e91f7487c052caf5cf98c954d204242f0af9 Updates: bz#1622665 Signed-off-by: Shwetha Acharya <sacharya@redhat.com>
* glusterd: reduce length allocated to nameSanju Rakonde2018-09-222-2/+2
| | | | | | | | | In glusterd_proc_ and glusterd_svc_ structures name is having length of PATH_MAX, allocating NAME_MAX will be sufficient. Change-Id: I637ba00e1a80ca6a1ecc0c2dbf180c4633c1ca5b updates: bz#1193929 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* glusterd: fix resource leak coverity issuesSanju Rakonde2018-09-223-8/+4
| | | | | | | | | | This patch addresses CID 1288098,1370948 and 1382454 key_fixed is allocated with memory but missed to free it. updates: bz#789278 Change-Id: Iea805c668ba89759313f9e21b328757e570be97b Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* glusterd: fix coverity issues in glusterd-locks.cSanju Rakonde2018-09-221-2/+11
| | | | | | | | | | | | | This patch addresses CID 1395254, CID 1382436. We are allocating memory to mgmt_lock_timer and key_dup. while doing GF_VALIDATE_OR_GOTO for mgmt_lock_timer_xl or mgmt_lock_timer_ctx, if it is null going to out without freeing the memory. This patch will fix the issues. updates: bz#789278 Change-Id: Ic6bfb2052982b16373f90cbbc53d2b2da052c01f Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* glusterd: don't wait for blockers flag for stop volumeAtin Mukherjee2018-09-221-1/+0
| | | | | | | | | | | | | | | With commit 4f6ae8 even though the overall transaction time for gluster volume stop can be reduced, but based on testing it can't be guaranteed that the transaction can finish in 3 minutes before the unlock timer gets kicked in. The ground problem to this is the command serialization which atomic field 'blockers' does for volume stop operation. This patch removes that dependency for volume stop not to wait for blockers. Change-Id: Ifaf120115dc7ed21cf21e65e25c4ec7c61ab8258 Fixes: bz#1631128 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* glusterd: Use GF_ATOMIC to update 'blockers' counter at glusterd_confMohit Agrawal2018-09-204-12/+11
| | | | | | | | | | | | | | | Problem: Currently in glusterd code uses sync_lock/sync_unlock to update blockers counter which could add delays to the overall transaction phase escpecially when there's a batch of volume stop operations processed by glusterd in brick multiplexing mode. Solution: Use GF_ATOMIC to update blocker counter to ensure unnecessary context switching can be avoided. Change-Id: Ie13177dfee2af66687ae7cf5c67405c152853990 Fixes: bz#1631128 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
* glusterd: fix crashSanju Rakonde2018-09-201-1/+1
| | | | | | | | | | | When huge number of volumes are created, glusterd crash is seen. With the core dump, got to know that mgmt_lock_timer became NULL. Adding a null check for the same, need to explore about the root cause. updates: bz#1630922 Change-Id: I0770063fcbbbf4b24bef29e94b857b20bdfb5b85 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>