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 /libglusterfs | |
| 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 'libglusterfs')
| -rw-r--r-- | libglusterfs/src/xlator.c | 15 | ||||
| -rw-r--r-- | libglusterfs/src/xlator.h | 1 | 
2 files changed, 16 insertions, 0 deletions
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)  { diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h index e0f82a70764..894785e7985 100644 --- a/libglusterfs/src/xlator.h +++ b/libglusterfs/src/xlator.h @@ -1030,6 +1030,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);  | 
