diff options
Diffstat (limited to 'fs/jfs/acl.c')
-rw-r--r-- | fs/jfs/acl.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c index 7bc186f4ed4d..2e71b6e7e646 100644 --- a/fs/jfs/acl.c +++ b/fs/jfs/acl.c | |||
@@ -77,13 +77,6 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int type, | |||
77 | switch (type) { | 77 | switch (type) { |
78 | case ACL_TYPE_ACCESS: | 78 | case ACL_TYPE_ACCESS: |
79 | ea_name = XATTR_NAME_POSIX_ACL_ACCESS; | 79 | ea_name = XATTR_NAME_POSIX_ACL_ACCESS; |
80 | if (acl) { | ||
81 | rc = posix_acl_update_mode(inode, &inode->i_mode, &acl); | ||
82 | if (rc) | ||
83 | return rc; | ||
84 | inode->i_ctime = current_time(inode); | ||
85 | mark_inode_dirty(inode); | ||
86 | } | ||
87 | break; | 80 | break; |
88 | case ACL_TYPE_DEFAULT: | 81 | case ACL_TYPE_DEFAULT: |
89 | ea_name = XATTR_NAME_POSIX_ACL_DEFAULT; | 82 | ea_name = XATTR_NAME_POSIX_ACL_DEFAULT; |
@@ -115,12 +108,27 @@ int jfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
115 | { | 108 | { |
116 | int rc; | 109 | int rc; |
117 | tid_t tid; | 110 | tid_t tid; |
111 | int update_mode = 0; | ||
112 | umode_t mode = inode->i_mode; | ||
118 | 113 | ||
119 | tid = txBegin(inode->i_sb, 0); | 114 | tid = txBegin(inode->i_sb, 0); |
120 | mutex_lock(&JFS_IP(inode)->commit_mutex); | 115 | mutex_lock(&JFS_IP(inode)->commit_mutex); |
116 | if (type == ACL_TYPE_ACCESS && acl) { | ||
117 | rc = posix_acl_update_mode(inode, &mode, &acl); | ||
118 | if (rc) | ||
119 | goto end_tx; | ||
120 | update_mode = 1; | ||
121 | } | ||
121 | rc = __jfs_set_acl(tid, inode, type, acl); | 122 | rc = __jfs_set_acl(tid, inode, type, acl); |
122 | if (!rc) | 123 | if (!rc) { |
124 | if (update_mode) { | ||
125 | inode->i_mode = mode; | ||
126 | inode->i_ctime = current_time(inode); | ||
127 | mark_inode_dirty(inode); | ||
128 | } | ||
123 | rc = txCommit(tid, 1, &inode, 0); | 129 | rc = txCommit(tid, 1, &inode, 0); |
130 | } | ||
131 | end_tx: | ||
124 | txEnd(tid); | 132 | txEnd(tid); |
125 | mutex_unlock(&JFS_IP(inode)->commit_mutex); | 133 | mutex_unlock(&JFS_IP(inode)->commit_mutex); |
126 | return rc; | 134 | return rc; |