diff options
Diffstat (limited to 'fs/ext2/acl.c')
-rw-r--r-- | fs/ext2/acl.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c index ced1c478ebdb..1226dbcc66f5 100644 --- a/fs/ext2/acl.c +++ b/fs/ext2/acl.c | |||
@@ -316,7 +316,7 @@ cleanup: | |||
316 | int | 316 | int |
317 | ext2_acl_chmod(struct inode *inode) | 317 | ext2_acl_chmod(struct inode *inode) |
318 | { | 318 | { |
319 | struct posix_acl *acl, *clone; | 319 | struct posix_acl *acl; |
320 | int error; | 320 | int error; |
321 | 321 | ||
322 | if (!test_opt(inode->i_sb, POSIX_ACL)) | 322 | if (!test_opt(inode->i_sb, POSIX_ACL)) |
@@ -326,14 +326,11 @@ ext2_acl_chmod(struct inode *inode) | |||
326 | acl = ext2_get_acl(inode, ACL_TYPE_ACCESS); | 326 | acl = ext2_get_acl(inode, ACL_TYPE_ACCESS); |
327 | if (IS_ERR(acl) || !acl) | 327 | if (IS_ERR(acl) || !acl) |
328 | return PTR_ERR(acl); | 328 | return PTR_ERR(acl); |
329 | clone = posix_acl_clone(acl, GFP_KERNEL); | 329 | error = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); |
330 | if (error) | ||
331 | return error; | ||
332 | error = ext2_set_acl(inode, ACL_TYPE_ACCESS, acl); | ||
330 | posix_acl_release(acl); | 333 | posix_acl_release(acl); |
331 | if (!clone) | ||
332 | return -ENOMEM; | ||
333 | error = posix_acl_chmod_masq(clone, inode->i_mode); | ||
334 | if (!error) | ||
335 | error = ext2_set_acl(inode, ACL_TYPE_ACCESS, clone); | ||
336 | posix_acl_release(clone); | ||
337 | return error; | 334 | return error; |
338 | } | 335 | } |
339 | 336 | ||