summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2017-09-15 14:49:50 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-09-17 13:37:32 +0000
commitd3b0205dbd299ff69883133ce22ca9d0623e87e2 (patch)
treeb9cf14264e55fc9910b04a5e0764df42f3c1d256 /libglusterfs
parentd31c45e659d0fd0b740ecfb98b3b92dc8dcca039 (diff)
afr: heal metadata in discover code path
****************************************************** Backport of: https://review.gluster.org/18202 Also added loc_is_nameless() to libglusterfs since the patch that introduced it in master was not backported to release-3.10. Note: 18202 is a squash of 17850 and 18187 in master. ****************************************************** During graph switch, if fuse sends nameless (gfid) lookups, afr takes the discover code path to serve it. If there are pending metadata heals, they do not happen unless an inode refresh happens as a part of discover (which is not guaranteed to happen always). This patch fixes it by attempting metadata heal as a part of discover, just like how it is done in lookup code path. Change-Id: I87c493045b9225741cad173bf3f645848697032e BUG: 1492010 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: https://review.gluster.org/18304 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/xlator.c13
-rw-r--r--libglusterfs/src/xlator.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index 0d09b3fbc82..16da028dc09 100644
--- a/libglusterfs/src/xlator.c
+++ b/libglusterfs/src/xlator.c
@@ -1025,6 +1025,19 @@ out:
return ret;
}
+gf_boolean_t
+loc_is_nameless (loc_t *loc)
+{
+ gf_boolean_t ret = _gf_false;
+
+ GF_VALIDATE_OR_GOTO ("xlator", loc, out);
+
+ if ((!loc->parent && gf_uuid_is_null (loc->pargfid)) || !loc->name)
+ ret = _gf_true;
+out:
+ return ret;
+}
+
int
xlator_destroy (xlator_t *xl)
{
diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h
index c2959efbd95..5fb26547d56 100644
--- a/libglusterfs/src/xlator.h
+++ b/libglusterfs/src/xlator.h
@@ -1029,6 +1029,7 @@ void loc_pargfid (loc_t *loc, uuid_t pargfid);
char* loc_gfid_utoa (loc_t *loc);
gf_boolean_t loc_is_root (loc_t *loc);
int32_t loc_build_child (loc_t *child, loc_t *parent, char *name);
+gf_boolean_t loc_is_nameless (loc_t *loc);
int xlator_mem_acct_init (xlator_t *xl, int num_types);
int is_gf_log_command (xlator_t *trans, const char *name, char *value);
int glusterd_check_log_level (const char *value);