summaryrefslogtreecommitdiffstats
path: root/xlators/system/posix-acl/src/posix-acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/system/posix-acl/src/posix-acl.c')
-rw-r--r--xlators/system/posix-acl/src/posix-acl.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c
index da2ccbd1c54..b1d3df396fb 100644
--- a/xlators/system/posix-acl/src/posix-acl.c
+++ b/xlators/system/posix-acl/src/posix-acl.c
@@ -1945,37 +1945,38 @@ handling_other_acl_related_xattr (xlator_t *this, inode_t *inode, dict_t *xattr)
data_t *data = NULL;
int ret = 0;
- ctx = posix_acl_ctx_get (inode, this);
- if (!ctx) {
- ret = -1;
- goto out;
- }
-
data = dict_get (xattr, POSIX_ACL_ACCESS_XATTR);
if (data) {
- ctx = posix_acl_ctx_get (inode, this);
- if (!ctx) {
+
+
+ acl = posix_acl_from_xattr (this, data->data, data->len);
+ if (!acl) {
ret = -1;
goto out;
}
- acl = posix_acl_from_xattr (this, data->data, data->len);
-
ret = posix_acl_set_specific (inode, this, acl, _gf_true);
if (ret)
goto out;
- if (acl)
- posix_acl_access_set_mode (acl, ctx);
-
- }
+ ctx = posix_acl_ctx_get (inode, this);
+ if (!ctx) {
+ ret = -1;
+ goto out;
+ }
- if (acl)
+ posix_acl_access_set_mode (acl, ctx);
posix_acl_unref (this, acl);
+ acl = NULL;
+ }
data = dict_get (xattr, POSIX_ACL_DEFAULT_XATTR);
if (data) {
acl = posix_acl_from_xattr (this, data->data, data->len);
+ if (!acl) {
+ ret = -1;
+ goto out;
+ }
ret = posix_acl_set_specific (inode, this, acl, _gf_false);
}