diff options
| -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, |
