From 284cd8851bfe60984d2f11b5c52fe3204ff43b06 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Tue, 16 May 2017 19:25:20 +0530 Subject: nl-cache: In case of nameless operations do not cache Issue: In nameless lookup/other fops, parent inode will be NULL, when we try to add the cache to the NULL inode, it causes a crash. Hence handle the scenario of nameless fops, and do not cache/serve the nameless fops. Change-Id: I3b90f882ac89e6aaf3419db89e6f890797f37700 BUG: 1451588 Signed-off-by: Poornima G Reviewed-on: https://review.gluster.org/17316 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri CentOS-regression: Gluster Build System --- libglusterfs/src/xlator.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libglusterfs/src/xlator.c') diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index ec7cbe08ad3..9da6d657707 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -1028,6 +1028,21 @@ 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) { -- cgit