aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/acl.c')
-rw-r--r--fs/jffs2/acl.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c
index 4933a8f8ecc9..71d022d38508 100644
--- a/fs/jffs2/acl.c
+++ b/fs/jffs2/acl.c
@@ -332,7 +332,7 @@ int jffs2_init_acl_post(struct inode *inode)
332 332
333int jffs2_acl_chmod(struct inode *inode) 333int jffs2_acl_chmod(struct inode *inode)
334{ 334{
335 struct posix_acl *acl, *clone; 335 struct posix_acl *acl;
336 int rc; 336 int rc;
337 337
338 if (S_ISLNK(inode->i_mode)) 338 if (S_ISLNK(inode->i_mode))
@@ -340,14 +340,11 @@ int jffs2_acl_chmod(struct inode *inode)
340 acl = jffs2_get_acl(inode, ACL_TYPE_ACCESS); 340 acl = jffs2_get_acl(inode, ACL_TYPE_ACCESS);
341 if (IS_ERR(acl) || !acl) 341 if (IS_ERR(acl) || !acl)
342 return PTR_ERR(acl); 342 return PTR_ERR(acl);
343 clone = posix_acl_clone(acl, GFP_KERNEL); 343 rc = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
344 if (rc)
345 return rc;
346 rc = jffs2_set_acl(inode, ACL_TYPE_ACCESS, acl);
344 posix_acl_release(acl); 347 posix_acl_release(acl);
345 if (!clone)
346 return -ENOMEM;
347 rc = posix_acl_chmod_masq(clone, inode->i_mode);
348 if (!rc)
349 rc = jffs2_set_acl(inode, ACL_TYPE_ACCESS, clone);
350 posix_acl_release(clone);
351 return rc; 348 return rc;
352} 349}
353 350