summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2011-08-30 12:27:27 +0530
committerVijay Bellur <vijay@gluster.com>2011-09-20 01:50:04 -0700
commit0f9502d5eb7e2f29e2428df3d55c28f3bc99b8ea (patch)
tree2b927120c3871e3dca7bc5a35d33a656879e2ff7
parentb2e14374e20440d8d298c3bdb7d8290354330967 (diff)
storage/posix: Filter custom getxattrs in lookupv3.2.4qa2
Change-Id: Icb67cd739410071a07a9511e28c075fe8e9b9eaf BUG: 3470 Reviewed-on: http://review.gluster.com/326 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <raghavendra@gluster.com>
-rw-r--r--xlators/storage/posix/src/posix.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 6d0786c29..69713c5a5 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -102,6 +102,36 @@ posix_forget (xlator_t *this, inode_t *inode)
return 0;
}
+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;
+}
+
static void
_posix_xattr_get_set (dict_t *xattr_req,
char *key,
@@ -117,7 +147,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)) {
@@ -209,6 +240,8 @@ _posix_xattr_get_set (dict_t *xattr_req,
filler->real_path, key);
}
}
+out:
+ return;
}