diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2011-08-30 12:39:36 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-09-20 01:50:21 -0700 |
commit | 780b9668b0e49126e720edd79c10bf2a87ad0a85 (patch) | |
tree | 00737b56b4aa5eaebae6be37650a590229c801cf | |
parent | e5c185d8b66f807d6ed9a8873cdcd1be2654cf93 (diff) |
storage/posix: Filter custom getxattrs in lookup
Change-Id: I98306f7246798422b3f0c04de29962bd5b62d03f
BUG: 3470
Reviewed-on: http://review.gluster.com/327
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <raghavendra@gluster.com>
-rw-r--r-- | xlators/storage/posix/src/posix.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index f0861d3b7..307562d2f 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -88,6 +88,36 @@ typedef struct { loc_t *loc; } posix_xattr_filler_t; +static char* posix_ignore_xattrs[] = { + "gfid-req", + GLUSTERFS_ENTRYLK_COUNT, + GLUSTERFS_INODELK_COUNT, + GLUSTERFS_POSIXLK_COUNT, + NULL +}; + +static gf_boolean_t +posix_xattr_ignorable (char *key, posix_xattr_filler_t *filler) +{ + int i = 0; + gf_boolean_t ignore = _gf_false; + + GF_ASSERT (key); + if (!key) + goto out; + for (i = 0; posix_ignore_xattrs[i]; i++) { + if (!strcmp (key, posix_ignore_xattrs[i])) { + ignore = _gf_true; + goto out; + } + } + if ((!strcmp (key, GF_CONTENT_KEY)) + && (!IA_ISREG (filler->stbuf->ia_type))) + ignore = _gf_true; +out: + return ignore; +} + int posix_forget (xlator_t *this, inode_t *inode) { @@ -113,7 +143,8 @@ _posix_xattr_get_set (dict_t *xattr_req, loc_t *loc = NULL; ssize_t req_size = 0; - + if (posix_xattr_ignorable (key, filler)) + goto out; /* should size be put into the data_t ? */ if (!strcmp (key, GF_CONTENT_KEY) && IA_ISREG (filler->stbuf->ia_type)) { @@ -206,6 +237,8 @@ _posix_xattr_get_set (dict_t *xattr_req, filler->real_path, key); } } +out: + return; } |