diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2014-11-05 09:04:50 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-11-16 23:08:35 -0800 |
commit | 4e8901f7201ec68f30dbdf452362fcf0f3ec16bc (patch) | |
tree | 853420c83ddde4ba8070e354479eb57160bd4ffe /xlators/storage/posix | |
parent | 6fbb140c293dcabaf6ec34315d7cc94de07c0782 (diff) |
storage/posix: Treat ENODATA/ENOATTR as success in bulk removexattr
Backport of http://review.gluster.org/9049
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.
BUG: 1163571
Change-Id: I009f4736f8b6362d7115f57a7d7aece74e56e4f6
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9109
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/storage/posix')
-rw-r--r-- | xlators/storage/posix/src/posix.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 3e3d14fc793..d8599881fb7 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -4170,8 +4170,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, |