diff options
Diffstat (limited to 'fs/btrfs/acl.c')
-rw-r--r-- | fs/btrfs/acl.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 2e9e69987a82..6df6d6ed74fd 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
@@ -112,12 +112,14 @@ static int btrfs_set_acl(struct btrfs_trans_handle *trans, | |||
112 | switch (type) { | 112 | switch (type) { |
113 | case ACL_TYPE_ACCESS: | 113 | case ACL_TYPE_ACCESS: |
114 | mode = inode->i_mode; | 114 | mode = inode->i_mode; |
115 | ret = posix_acl_equiv_mode(acl, &mode); | ||
116 | if (ret < 0) | ||
117 | return ret; | ||
118 | ret = 0; | ||
119 | inode->i_mode = mode; | ||
120 | name = POSIX_ACL_XATTR_ACCESS; | 115 | name = POSIX_ACL_XATTR_ACCESS; |
116 | if (acl) { | ||
117 | ret = posix_acl_equiv_mode(acl, &mode); | ||
118 | if (ret < 0) | ||
119 | return ret; | ||
120 | inode->i_mode = mode; | ||
121 | } | ||
122 | ret = 0; | ||
121 | break; | 123 | break; |
122 | case ACL_TYPE_DEFAULT: | 124 | case ACL_TYPE_DEFAULT: |
123 | if (!S_ISDIR(inode->i_mode)) | 125 | if (!S_ISDIR(inode->i_mode)) |
@@ -242,6 +244,7 @@ int btrfs_init_acl(struct btrfs_trans_handle *trans, | |||
242 | ACL_TYPE_ACCESS); | 244 | ACL_TYPE_ACCESS); |
243 | } | 245 | } |
244 | } | 246 | } |
247 | posix_acl_release(clone); | ||
245 | } | 248 | } |
246 | failed: | 249 | failed: |
247 | posix_acl_release(acl); | 250 | posix_acl_release(acl); |