diff options
author | Poornima G <pgurusid@redhat.com> | 2017-05-16 19:25:20 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-05-25 15:30:34 +0000 |
commit | b8b398a5ee7a0e02582b2c441548bd758ebdb71c (patch) | |
tree | f5bec5194fc03edea68137273063e7a419b8dcf2 /xlators/performance | |
parent | 078083aa58bad16d42820e1ab1e6e54a3792633e (diff) |
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.
>Reviewed-on: https://review.gluster.org/17316
>Smoke: Gluster Build System <jenkins@build.gluster.org>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
>Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
>(cherry picked from commit 284cd8851bfe60984d2f11b5c52fe3204ff43b06)
Change-Id: I3b90f882ac89e6aaf3419db89e6f890797f37700
BUG: 1454569
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-on: https://review.gluster.org/17361
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'xlators/performance')
-rw-r--r-- | xlators/performance/nl-cache/src/nl-cache.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/xlators/performance/nl-cache/src/nl-cache.c b/xlators/performance/nl-cache/src/nl-cache.c index 675b5de24bf..295d5f67515 100644 --- a/xlators/performance/nl-cache/src/nl-cache.c +++ b/xlators/performance/nl-cache/src/nl-cache.c @@ -198,6 +198,8 @@ nlc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; conf = this->private; + GF_VALIDATE_OR_GOTO (this->name, local, out); + /* Donot add to pe, this may lead to duplicate entry and * requires search before adding if list of strings */ if (op_ret < 0 && op_errno == ENOENT) { @@ -205,8 +207,9 @@ nlc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, GF_ATOMIC_INC (conf->nlc_counter.nlc_miss); } +out: NLC_STACK_UNWIND (lookup, frame, op_ret, op_errno, inode, buf, xdata, - postparent); + postparent); return 0; } @@ -218,15 +221,15 @@ nlc_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) nlc_conf_t *conf = NULL; inode_t *inode = NULL; + if (loc_is_nameless (loc)) + goto wind; + local = nlc_local_init (frame, this, GF_FOP_LOOKUP, loc, NULL); if (!local) goto err; conf = this->private; - if ((!loc->parent && gf_uuid_is_null (loc->pargfid)) || !loc->name) - goto wind; - inode = inode_grep (loc->inode->table, loc->parent, loc->name); if (inode) { inode_unref (inode); |