diff options
author | Mike Marshall <hubcap@omnibond.com> | 2017-08-10 19:50:50 +0200 |
---|---|---|
committer | Mike Marshall <hubcap@omnibond.com> | 2017-09-14 20:54:38 +0200 |
commit | 4bef69000d93799b6b3983c45c81b3cb2cceaa99 (patch) | |
tree | b2d1abbae5e2e0700ccfffed17fd956b6a380e08 /fs | |
parent | orangefs: Don't clear SGID when inheriting ACLs (diff) | |
download | linux-4bef69000d93799b6b3983c45c81b3cb2cceaa99.tar.xz linux-4bef69000d93799b6b3983c45c81b3cb2cceaa99.zip |
orangefs: react properly to posix_acl_update_mode's aftermath.
posix_acl_update_mode checks to see if the permissions
described by the ACL can be encoded into the
object's mode. If so, it sets "acl" to NULL
and "mode" to the new desired value. Prior to this patch
we failed to actually propagate the new mode back to the
server.
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/orangefs/acl.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/fs/orangefs/acl.c b/fs/orangefs/acl.c index 9409aac232f7..45f27cf51fd8 100644 --- a/fs/orangefs/acl.c +++ b/fs/orangefs/acl.c @@ -119,11 +119,18 @@ out: int orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type) { int error; + struct iattr iattr; + int rc; if (type == ACL_TYPE_ACCESS && acl) { - umode_t mode; - - error = posix_acl_update_mode(inode, &mode, &acl); + /* + * posix_acl_update_mode checks to see if the permissions + * described by the ACL can be encoded into the + * object's mode. If so, it sets "acl" to NULL + * and "mode" to the new desired value. It is up to + * us to propagate the new mode back to the server... + */ + error = posix_acl_update_mode(inode, &iattr.ia_mode, &acl); if (error) { gossip_err("%s: posix_acl_update_mode err: %d\n", __func__, @@ -131,12 +138,18 @@ int orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type) return error; } - if (inode->i_mode != mode) - SetModeFlag(ORANGEFS_I(inode)); - inode->i_mode = mode; - mark_inode_dirty_sync(inode); + if (acl) { + rc = __orangefs_set_acl(inode, acl, type); + } else { + iattr.ia_valid = ATTR_MODE; + rc = orangefs_inode_setattr(inode, &iattr); + } + + return rc; + + } else { + return -EINVAL; } - return __orangefs_set_acl(inode, acl, type); } int orangefs_init_acl(struct inode *inode, struct inode *dir) |