From d3b0205dbd299ff69883133ce22ca9d0623e87e2 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Fri, 15 Sep 2017 14:49:50 +0530 Subject: 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 Reviewed-on: https://review.gluster.org/18304 Smoke: Gluster Build System Reviewed-by: Pranith Kumar Karampuri CentOS-regression: Gluster Build System Reviewed-by: Shyamsundar Ranganathan --- libglusterfs/src/xlator.c | 13 +++++++++++++ libglusterfs/src/xlator.h | 1 + 2 files changed, 14 insertions(+) (limited to 'libglusterfs') 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); -- cgit