diff options
| author | Richard Wareing <rwareing@fb.com> | 2015-09-29 15:35:08 -0700 |
|---|---|---|
| committer | Shreyas Siravara <sshreyas@fb.com> | 2017-08-29 22:32:43 +0000 |
| commit | 24932f2fd323deb4acab4e0c29601d5ca955f602 (patch) | |
| tree | 1286d069dcec24aab15186ccd89b7ec8ca8dc9c3 | |
| parent | 8c50512d129b11778e2fd88c8976a527515546d7 (diff) | |
cluster/afr: SHD should not use did_discovery code paths
Summary: - Exempt the SHD from the discover code path
Test Plan:
- prove -v tests/bugs/fb8149516.t
- Make rc and canary on offending host (gfsdataswarm048.prn2)
Reviewers: moox, dph, sshreyas
Reviewed By: sshreyas
Differential Revision: https://phabricator.fb.com/D2491694
Change-Id: I5ec3997cf26375e834c3c7c4ea6c174eef957b8b
Signed-off-by: Jeff Darcy <jdarcy@fb.com>
Reviewed-on: https://review.gluster.org/18141
Tested-by: Jeff Darcy <jeff@pl.atyp.us>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Shreyas Siravara <sshreyas@fb.com>
| -rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-common.c | 3 | ||||
| -rw-r--r-- | xlators/cluster/afr/src/afr.h | 2 | ||||
| -rw-r--r-- | xlators/nfs/server/src/mount3.c | 3 |
3 files changed, 7 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 4a5c95477ee..1df3ddde1cb 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -1891,7 +1891,8 @@ afr_selfheal_unlocked_inspect (call_frame_t *frame, xlator_t *this, afr_is_metadata_set (this, replies[i].xdata)) *metadata_selfheal = _gf_true; - if (priv->did_discovery == _gf_false || + if ((!priv->shd.iamshd && AFR_IS_ROOT_GFID (gfid) && + priv->did_discovery == _gf_false) || (entry_selfheal && afr_is_entry_set (this, replies[i].xdata))) *entry_selfheal = _gf_true; diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 1d6a0dc5157..b61f6f67460 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -51,6 +51,8 @@ typedef int (*afr_changelog_resume_t) (call_frame_t *frame, xlator_t *this); #define alloca0(size) ({void *__ptr; __ptr = alloca(size); memset(__ptr, 0, size); __ptr;}) #define AFR_COUNT(array,max) ({int __i; int __res = 0; for (__i = 0; __i < max; __i++) if (array[__i]) __res++; __res;}) #define AFR_INTERSECT(dst,src1,src2,max) ({int __i; for (__i = 0; __i < max; __i++) dst[__i] = src1[__i] && src2[__i];}) +#define AFR_ROOT_GFID "00000000-0000-0000-0000-000000000001" +#define AFR_IS_ROOT_GFID(g) (strcmp (uuid_utoa(g), AFR_ROOT_GFID) == 0) #define AFR_CMP(a1,a2,len) ({int __cmp = 0; int __i; for (__i = 0; __i < len; __i++) if (a1[__i] != a2[__i]) { __cmp = 1; break;} __cmp;}) #define AFR_IS_ARBITER_BRICK(priv, index) ((priv->arbiter_count == 1) && (index == ARBITER_BRICK_INDEX)) diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c index 0a3d79af6f0..525c83c150f 100644 --- a/xlators/nfs/server/src/mount3.c +++ b/xlators/nfs/server/src/mount3.c @@ -1193,6 +1193,9 @@ mnt3_resolve_subdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, /* Build mountid from the authorized path and stick it in the * filehandle that will get passed back to the client */ + if (!authorized_path) { + goto err; + } __mnt3_build_mountid_from_path (authorized_path, fh.mountid); snprintf (path, PATH_MAX, "/%s%s", mres->exp->vol->name, |
