summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2014-11-05 09:04:50 +0530
committerVijay Bellur <vbellur@redhat.com>2014-11-05 21:42:52 -0800
commitb42255e87a06679b803e6bd83d02465d82c357b6 (patch)
tree380b9ebae9033965fd793b46a646669d598cbb12 /xlators/storage
parent8528253ddbac4cbcb7ce4881c085d9bfc0a82703 (diff)
storage/posix: Treat ENODATA/ENOATTR as success in bulk removexattr
Bulk remove xattr is internal fop in gluster. Some of the xattrs may have special behavior. Ex: removexattr("posix.system_acl_access"), removes more than one xattr on the file that could be present in the bulk-removal request. Removexattr of these deleted xattrs will fail with either ENODATA/ENOATTR. Since all this fop cares is removal of the xattrs in bulk-remove request and if they are already deleted, it can be treated as success. Change-Id: Id8f2a39b68ab763ec8b04cb71b47977647f22da4 BUG: 1160509 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9049 Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/storage')
-rw-r--r--xlators/storage/posix/src/posix.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 9f7fa0313cd..cd9889260ee 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -4171,8 +4171,22 @@ _posix_remove_xattr (dict_t *dict, char *key, data_t *value, void *data)
key = newkey;
}
#endif
+ /* Bulk remove xattr is internal fop in gluster. Some of the xattrs may
+ * have special behavior. Ex: removexattr("posix.system_acl_access"),
+ * removes more than one xattr on the file that could be present in the
+ * bulk-removal request. Removexattr of these deleted xattrs will fail
+ * with either ENODATA/ENOATTR. Since all this fop cares is removal of the
+ * xattrs in bulk-remove request and if they are already deleted, it can be
+ * treated as success.
+ */
+
op_ret = sys_lremovexattr (filler->real_path, key);
if (op_ret == -1) {
+ if (errno == ENODATA || errno == ENOATTR)
+ op_ret = 0;
+ }
+
+ if (op_ret == -1) {
filler->op_errno = errno;
if (errno != ENOATTR && errno != ENODATA && errno != EPERM)
gf_log (this->name, GF_LOG_ERROR,