aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/9p/acl.c')
-rw-r--r--fs/9p/acl.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/fs/9p/acl.c b/fs/9p/acl.c
index 31c010372660..de59b4892bfb 100644
--- a/fs/9p/acl.c
+++ b/fs/9p/acl.c
@@ -320,32 +320,26 @@ static int v9fs_xattr_set_acl(struct dentry *dentry, const char *name,
320 case ACL_TYPE_ACCESS: 320 case ACL_TYPE_ACCESS:
321 name = POSIX_ACL_XATTR_ACCESS; 321 name = POSIX_ACL_XATTR_ACCESS;
322 if (acl) { 322 if (acl) {
323 umode_t mode = inode->i_mode; 323 struct iattr iattr;
324 retval = posix_acl_equiv_mode(acl, &mode); 324
325 if (retval < 0) 325 retval = posix_acl_update_mode(inode, &iattr.ia_mode, &acl);
326 if (retval)
326 goto err_out; 327 goto err_out;
327 else { 328 if (!acl) {
328 struct iattr iattr; 329 /*
329 if (retval == 0) { 330 * ACL can be represented
330 /* 331 * by the mode bits. So don't
331 * ACL can be represented 332 * update ACL.
332 * by the mode bits. So don't
333 * update ACL.
334 */
335 acl = NULL;
336 value = NULL;
337 size = 0;
338 }
339 /* Updte the mode bits */
340 iattr.ia_mode = ((mode & S_IALLUGO) |
341 (inode->i_mode & ~S_IALLUGO));
342 iattr.ia_valid = ATTR_MODE;
343 /* FIXME should we update ctime ?
344 * What is the following setxattr update the
345 * mode ?
346 */ 333 */
347 v9fs_vfs_setattr_dotl(dentry, &iattr); 334 value = NULL;
335 size = 0;
348 } 336 }
337 iattr.ia_valid = ATTR_MODE;
338 /* FIXME should we update ctime ?
339 * What is the following setxattr update the
340 * mode ?
341 */
342 v9fs_vfs_setattr_dotl(dentry, &iattr);
349 } 343 }
350 break; 344 break;
351 case ACL_TYPE_DEFAULT: 345 case ACL_TYPE_DEFAULT: