summaryrefslogtreecommitdiff
path: root/fs/9p/acl.c
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2017-03-14 13:59:28 -0700
committerMax Krummenacher <max.krummenacher@toradex.com>2017-03-15 18:35:51 +0100
commit39ac0033f2345ce7b5d8ca4439192407dacb2355 (patch)
tree51dc588baa63d31bc406388885f62c1cae068fa3 /fs/9p/acl.c
parent13f2767f31803754aa883f298737aff866f04628 (diff)
parentd9e0350d2575a20ee7783427da9bd6b6107eb983 (diff)
Merge tag 'v4.1.39' into toradex_vf_4.1-nexttoradex_vf_4.1
Linux 4.1.39
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,
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));
- iattr.ia_valid = ATTR_MODE;
- /* FIXME should we update ctime ?
- * What is the following setxattr update the
- * mode ?
+ if (!acl) {
+ /*
+ * ACL can be represented
+ * by the mode bits. So don't
+ * update ACL.
*/
- v9fs_vfs_setattr_dotl(dentry, &iattr);
+ 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: