diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2014-11-06 10:37:06 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-11-11 03:33:41 -0800 |
commit | ffa4263c2f8fcb95ed5553a5a114bc26a920ad27 (patch) | |
tree | fc07cd3bb16416e5e2cb0736d0ff5ab12ba4bf47 /xlators/cluster/afr/src/afr-self-heal-metadata.c | |
parent | 98f82412986339626bcd1218ff1da0fbb2664d6d (diff) |
features/marker: Filter internal xattrs in lookup
Afr should ignore quota-size-key as part of self-heal
but should heal quota-limit key.
Change-Id: Ic0b06bd20a563a00d6bfdc2dc5a76c661e533ecb
BUG: 1161106
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9061
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-metadata.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-metadata.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c index 96b3262e471..dced4d07df6 100644 --- a/xlators/cluster/afr/src/afr-self-heal-metadata.c +++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c @@ -20,6 +20,19 @@ #define AFR_HEAL_ATTR (GF_SET_ATTR_UID|GF_SET_ATTR_GID|GF_SET_ATTR_MODE) +static gf_boolean_t +_afr_ignorable_key_match (dict_t *d, char *k, data_t *val, void *mdata) +{ + return afr_is_xattr_ignorable (k); +} + +void +afr_delete_ignorable_xattrs (dict_t *xattr) +{ + dict_foreach_match (xattr, _afr_ignorable_key_match, NULL, + dict_remove_foreach_fn, NULL); +} + int __afr_selfheal_metadata_do (call_frame_t *frame, xlator_t *this, inode_t *inode, int source, unsigned char *healed_sinks, @@ -46,8 +59,7 @@ __afr_selfheal_metadata_do (call_frame_t *frame, xlator_t *this, inode_t *inode, goto out; } - afr_filter_xattrs (xattr); - dict_del (xattr, GF_SELINUX_XATTR_KEY); + afr_delete_ignorable_xattrs (xattr); for (i = 0; i < priv->child_count; i++) { if (old_xattr) { @@ -66,8 +78,7 @@ __afr_selfheal_metadata_do (call_frame_t *frame, xlator_t *this, inode_t *inode, ret = syncop_getxattr (priv->children[i], &loc, &old_xattr, 0); if (old_xattr) { - dict_del (old_xattr, GF_SELINUX_XATTR_KEY); - afr_filter_xattrs (old_xattr); + afr_delete_ignorable_xattrs (old_xattr); ret = syncop_removexattr (priv->children[i], &loc, "", old_xattr); } |