X-Git-Url: https://git.stricted.de/?p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git;a=blobdiff_plain;f=fs%2F9p%2Facl.c;h=142180cd805531987812088630111a88416724a5;hp=7af425f53beef91a6d21dc86b76e161ff7ed1696;hb=4b9e97964ece8e69e3ee875ffa500fd7e24c7bb0;hpb=a5e0d73163a848060ac0c2c054274e84a654986e diff --git a/fs/9p/acl.c b/fs/9p/acl.c index 7af425f53bee..142180cd8055 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, case ACL_TYPE_ACCESS: name = POSIX_ACL_XATTR_ACCESS; if (acl) { - umode_t mode = inode->i_mode; - retval = posix_acl_equiv_mode(acl, &mode); - if (retval < 0) + struct iattr iattr; + + retval = posix_acl_update_mode(inode, &iattr.ia_mode, &acl); + if (retval) goto err_out; - else { - struct iattr iattr; - if (retval == 0) { - /* - * ACL can be represented - * by the mode bits. So don't - * update ACL. - */ - acl = NULL; - value = NULL; - size = 0; - } - /* Updte the mode bits */ - iattr.ia_mode = ((mode & S_IALLUGO) | - (inode->i_mode & ~S_IALLUGO)); + if (!acl) { + /* + * ACL can be represented + * by the mode bits. So don't + * update ACL. + */ + value = NULL; + size = 0; + } iattr.ia_valid = ATTR_MODE; /* FIXME should we update ctime ? * What is the following setxattr update the * mode ? */ v9fs_vfs_setattr_dotl(dentry, &iattr); - } } break; case ACL_TYPE_DEFAULT: