|
@@ -276,32 +276,26 @@ static int v9fs_xattr_set_acl(const struct xattr_handler *handler,
|
|
switch (handler->flags) {
|
|
switch (handler->flags) {
|
|
case ACL_TYPE_ACCESS:
|
|
case ACL_TYPE_ACCESS:
|
|
if (acl) {
|
|
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;
|
|
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;
|
|
break;
|
|
case ACL_TYPE_DEFAULT:
|
|
case ACL_TYPE_DEFAULT:
|