aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/acl.c')
-rw-r--r--fs/btrfs/acl.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index 65a735d8f6e4..59086142c14d 100644
--- a/fs/btrfs/acl.c
+++ b/fs/btrfs/acl.c
@@ -222,19 +222,16 @@ int btrfs_init_acl(struct btrfs_trans_handle *trans,
222 } 222 }
223 223
224 if (IS_POSIXACL(dir) && acl) { 224 if (IS_POSIXACL(dir) && acl) {
225 mode_t mode = inode->i_mode;
226
227 if (S_ISDIR(inode->i_mode)) { 225 if (S_ISDIR(inode->i_mode)) {
228 ret = btrfs_set_acl(trans, inode, acl, 226 ret = btrfs_set_acl(trans, inode, acl,
229 ACL_TYPE_DEFAULT); 227 ACL_TYPE_DEFAULT);
230 if (ret) 228 if (ret)
231 goto failed; 229 goto failed;
232 } 230 }
233 ret = posix_acl_create(&acl, GFP_NOFS, &mode); 231 ret = posix_acl_create(&acl, GFP_NOFS, &inode->i_mode);
234 if (ret < 0) 232 if (ret < 0)
235 return ret; 233 return ret;
236 234
237 inode->i_mode = mode;
238 if (ret > 0) { 235 if (ret > 0) {
239 /* we need an acl */ 236 /* we need an acl */
240 ret = btrfs_set_acl(trans, inode, acl, ACL_TYPE_ACCESS); 237 ret = btrfs_set_acl(trans, inode, acl, ACL_TYPE_ACCESS);