summaryrefslogtreecommitdiffstats
path: root/heal
Commit message (Collapse)AuthorAgeFilesLines
* api: versioned symbols in libgfapi.so for compatibilityKaleb S. KEITHLEY2015-02-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use versioned symbols to keep libgfapi at libgfapi.so.0.0.0 Some nits uncovered: + there are a couple functions declared that do not have an associated definition, e.g. glfs_truncate(), glfs_caller_specific_init() + there are five private/internal functions used by heal/src/glfsheal and the gfapi master xlator (glfs-master.c): glfs_loc_touchup(), glfs_active_subvol(), and glfs_subvol_done(), glfs_init_done(), glfs_resolve_at(); which are not declared in glfs.h; + for this initial pass at versioned symbols, we use the earliest version of all public symbols, i.e. those for which there are declarations in glfs.h or glfs-handles.h. Further investigation as we do backports to 3.6, 3.4, and 3.4 will be required to determine if older implementations need to be preserved (forward ported) and their associated alias(es) and symbol version(s) defined. FWIW, we should consider linking all of our libraries with a map, it'll result in a cleaner ABI. Perhaps something for an intern to do or a Google Summer of Code project. Change-Id: I513b9aad9c5fd7d8b34ff33acac35f37b6baaab6 BUG: 1160711 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/9056 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* core: fix Ubuntu code audit (cppcheck) resultsKaleb S. KEITHLEY2014-11-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See http://review.gluster.org/#/c/7583/ BZ 1086460 AFAICT these are false positives: [geo-replication/src/gsyncd.c:99]: (error) Memory leak: str [geo-replication/src/gsyncd.c:395]: (error) Memory leak: argv [xlators/nfs/server/src/nlm4.c:1200]: (error) Possible null pointer dereference: fde Program exits, resource leak not an issue [extras/geo-rep/gsync-sync-gfid.c:105]: (error) Resource leak: fp Test program: [extras/test/test-ffop.c:27]: (error) Buffer overrun possible for long command line arguments. Not built: [xlators/cluster/ha/src/ha.c:2699]: (error) Possible null pointer dereference: priv The remainder are fixed with this change-set: [heal/src/glfs-heal.c:357]: (error) Possible null pointer dereference: remote_subvol [libglusterfs/src/xlator.c:648]: (error) Uninitialized variable: gfid [libglusterfs/src/xlator.c:649]: (error) Uninitialized variable: gfid [xlators/cluster/afr/src/afr-inode-write.c:469]: (error) Possible null pointer dereference: frame [xlators/cluster/afr/src/afr-self-heal-common.c:1704]: (error) Possible null pointer dereference: local [xlators/cluster/dht/src/dht-rebalance.c:1643]: (error) Possible null pointer dereference: ctx [xlators/cluster/stripe/src/stripe.c:4963]: (error) Possible null pointer dereference: local [xlators/features/changelog/src/changelog.c:1464]: (error) Possible null pointer dereference: priv [xlators/mgmt/glusterd/src/glusterd-geo-rep.c:1656]: (error) Possible null pointer dereference: command [xlators/mgmt/glusterd/src/glusterd-replace-brick.c:914]: (error) Resource leak: file [xlators/mgmt/glusterd/src/glusterd-replace-brick.c:998]: (error) Resource leak: file [xlators/mgmt/glusterd/src/glusterd-sm.c:248]: (error) Possible null pointer dereference: new_ev_ctx [xlators/mgmt/glusterd/src/glusterd-store.c:1332]: (error) Possible null pointer dereference: handle [xlators/mgmt/glusterd/src/glusterd-utils.c:4706]: (error) Possible null pointer dereference: this [xlators/mgmt/glusterd/src/glusterd-utils.c:5613]: (error) Possible null pointer dereference: this [xlators/mgmt/glusterd/src/glusterd-utils.c:6342]: (error) Possible null pointer dereference: path_tokens [xlators/mgmt/glusterd/src/glusterd-utils.c:6343]: (error) Possible null pointer dereference: path_tokens [xlators/mount/fuse/src/fuse-bridge.c:4591]: (error) Uninitialized variable: finh [xlators/mount/fuse/src/fuse-bridge.c:3004]: (error) Possible null pointer dereference: state [xlators/nfs/server/src/nfs-common.c:89]: (error) Dangerous usage of 'volname' (strncpy doesn't always null-terminate it). [xlators/performance/quick-read/src/quick-read.c:585]: (error) Possible null pointer dereference: iobuf Rerunning cppcheck afterwards: As before, test program: [extras/test/test-ffop.c:27]: (error) Buffer overrun possible for long command line arguments. As before, believed to be false positive: [geo-replication/src/gsyncd.c:99]: (error) Memory leak: str [geo-replication/src/gsyncd.c:395]: (error) Memory leak: argv [xlators/nfs/server/src/nlm4.c:1200]: (error) Possible null pointer dereference: fde As before, not built: [xlators/cluster/ha/src/ha.c:2699]: (error) Possible null pointer dereference: priv False positive after fix: [heal/src/glfs-heal.c:356]: (error) Possible null pointer dereference: remote_subvol [xlators/cluster/stripe/src/stripe.c:4963]: (error) Possible null pointer dereference: local Change-Id: Ib3029d3223f5a13e2ac386a527d64d5ffe3ecb90 BUG: 1092037 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/7605 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* cluster/afr : Prevent excessive logging of split-brain messages.Anuradha2014-11-131-4/+22
| | | | | | | | | | | | | | | | | Running the volume heal info command would result in excessive logging of split-brain messages. After this patch, running heal info command will not log the split brain messages. This info is now displayed in the output of heal info command instead. If a file is in split-brain, a message "Is in split-brain" will be written against its name. Change-Id: Ib8979be04f5ac7c59ce3ad1185886bb54b8be808 BUG: 1161102 Signed-off-by: Anuradha <atalur@redhat.com> Reviewed-on: http://review.gluster.org/9069 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* heal:Do not ignore return value of syncop_getxattr()Ravishankar N2014-09-231-4/+12
| | | | | | | | | | | | | | | | | | | | Problem: In glfs-heal.c, we are currently ignoring the return value of syncop_getxattr() in glfsh_process_entries(). This can cause random characters to be printed in the heal-info command when stale entries are present in indices/xattrop directory. Fix: Check and purge stale entries instead of printing them, depending on the 'ret' value of syncop_getxattr(). Change-Id: I6c87f3ab3fecde48cdbf7578a85782a1d2f1d55b BUG: 1141558 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/8711 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* heal: fix the way we check the presence of AFR in glfshealRavishankar N2014-07-181-15/+27
| | | | | | | | | | | | | | | | | | | | | Problem: glfsh_validate_replicate_volume() used to check if AFR was the parent of all client xlators present in the graph. This need not always be true, for example, for user-serviceable-snapshots where the parent of snapd-client is snapview-client. Fix: glfsh_validate_replicate_volume() returns true if atleast one client xlator has AFR as its parent. Also, AFR need not be its immediate parent, but be present somewhere in its parent ancestry. Change-Id: Id37ac88c3202bb2fdcae56e108adc461dc8a9a37 BUG: 1115950 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/8229 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* heal: Don't depend on errno for reporting heal info statusPranith Kumar K2014-06-071-2/+4
| | | | | | | | | | | | | Change the interfaces to return errno in 'return value' to prevent errno being over-written in glfsh_print_brick_from_xl. Change-Id: I425c85e496a885ed3cd0aeef86d4616aa21bb1b5 BUG: 1104592 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/7965 Reviewed-by: Ravishankar N <ravishankar@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* cluster/afr: Prevent heal info hang when data-self-heal in progress.Pranith Kumar K2014-04-281-2/+21
| | | | | | | | | | | | | | | | | | | | | | | Problem: For determining whether data-self-heal is needed afr takes blocking locks. So if self-heal is indeed in progress on the file, this leads to hangs. heal info hung for almost 50 minutes when a 50G file is undergoing heal. Fix: When self-heal is in progress there is a live self-heal-domain lock. In this stage if a non-blocking inodelk for self-heal-domain lock is performed it will fail with EAGAIN. For heal info we can use this logic to determing that the file is possibly undergoing heal and inform it to user instead of waiting for the completion of self-heal. Change-Id: I18527c59e429602bae49c98ff45502833ab8e1f0 BUG: 1039544 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/7482 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Ravishankar N <ravishankar@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* heal: Enable logging for glfsheal.Pranith Kumar K2014-04-281-6/+19
| | | | | | | | | | | | | | logs will be written to <log-dir>/glfsheal-<volname>.log Moved some non-essential frequent logs to DEBUG. BUG: 1039544 Change-Id: I2aceda6e3092f8c5052e7a4b8b5dec3cdeebd9a9 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/7481 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Ravishankar N <ravishankar@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* heal: glfs-heal implementationPranith Kumar K2014-04-283-0/+519
Change-Id: I634f24d90cd856ceab3cc0c6e9a91003f443403e BUG: 1039544 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/6511 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Ravishankar N <ravishankar@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>