diff options
-rw-r--r-- | fs/reiserfs/xattr_acl.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c index d92a1dc6ee70..54415f0e3d18 100644 --- a/fs/reiserfs/xattr_acl.c +++ b/fs/reiserfs/xattr_acl.c | |||
@@ -23,7 +23,8 @@ reiserfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
23 | struct reiserfs_transaction_handle th; | 23 | struct reiserfs_transaction_handle th; |
24 | size_t jcreate_blocks; | 24 | size_t jcreate_blocks; |
25 | int size = acl ? posix_acl_xattr_size(acl->a_count) : 0; | 25 | int size = acl ? posix_acl_xattr_size(acl->a_count) : 0; |
26 | 26 | int update_mode = 0; | |
27 | umode_t mode = inode->i_mode; | ||
27 | 28 | ||
28 | /* | 29 | /* |
29 | * Pessimism: We can't assume that anything from the xattr root up | 30 | * Pessimism: We can't assume that anything from the xattr root up |
@@ -38,12 +39,14 @@ reiserfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
38 | reiserfs_write_unlock(inode->i_sb); | 39 | reiserfs_write_unlock(inode->i_sb); |
39 | if (error == 0) { | 40 | if (error == 0) { |
40 | if (type == ACL_TYPE_ACCESS && acl) { | 41 | if (type == ACL_TYPE_ACCESS && acl) { |
41 | error = posix_acl_update_mode(inode, &inode->i_mode, | 42 | error = posix_acl_update_mode(inode, &mode, &acl); |
42 | &acl); | ||
43 | if (error) | 43 | if (error) |
44 | goto unlock; | 44 | goto unlock; |
45 | update_mode = 1; | ||
45 | } | 46 | } |
46 | error = __reiserfs_set_acl(&th, inode, type, acl); | 47 | error = __reiserfs_set_acl(&th, inode, type, acl); |
48 | if (!error && update_mode) | ||
49 | inode->i_mode = mode; | ||
47 | unlock: | 50 | unlock: |
48 | reiserfs_write_lock(inode->i_sb); | 51 | reiserfs_write_lock(inode->i_sb); |
49 | error2 = journal_end(&th); | 52 | error2 = journal_end(&th); |