aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jfs')
-rw-r--r--fs/jfs/acl.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c
index ead200eef5e4..89ced71e225a 100644
--- a/fs/jfs/acl.c
+++ b/fs/jfs/acl.c
@@ -177,8 +177,9 @@ cleanup:
177 177
178int jfs_acl_chmod(struct inode *inode) 178int jfs_acl_chmod(struct inode *inode)
179{ 179{
180 struct posix_acl *acl, *clone; 180 struct posix_acl *acl;
181 int rc; 181 int rc;
182 tid_t tid;
182 183
183 if (S_ISLNK(inode->i_mode)) 184 if (S_ISLNK(inode->i_mode))
184 return -EOPNOTSUPP; 185 return -EOPNOTSUPP;
@@ -187,22 +188,18 @@ int jfs_acl_chmod(struct inode *inode)
187 if (IS_ERR(acl) || !acl) 188 if (IS_ERR(acl) || !acl)
188 return PTR_ERR(acl); 189 return PTR_ERR(acl);
189 190
190 clone = posix_acl_clone(acl, GFP_KERNEL); 191 rc = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
191 posix_acl_release(acl); 192 if (rc)
192 if (!clone) 193 return rc;
193 return -ENOMEM;
194
195 rc = posix_acl_chmod_masq(clone, inode->i_mode);
196 if (!rc) {
197 tid_t tid = txBegin(inode->i_sb, 0);
198 mutex_lock(&JFS_IP(inode)->commit_mutex);
199 rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, clone);
200 if (!rc)
201 rc = txCommit(tid, 1, &inode, 0);
202 txEnd(tid);
203 mutex_unlock(&JFS_IP(inode)->commit_mutex);
204 }
205 194
206 posix_acl_release(clone); 195 tid = txBegin(inode->i_sb, 0);
196 mutex_lock(&JFS_IP(inode)->commit_mutex);
197 rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, acl);
198 if (!rc)
199 rc = txCommit(tid, 1, &inode, 0);
200 txEnd(tid);
201 mutex_unlock(&JFS_IP(inode)->commit_mutex);
202
203 posix_acl_release(acl);
207 return rc; 204 return rc;
208} 205}