aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Marshall <hubcap@omnibond.com>2017-08-10 13:50:50 -0400
committerMike Marshall <hubcap@omnibond.com>2017-09-14 14:54:38 -0400
commit4bef69000d93799b6b3983c45c81b3cb2cceaa99 (patch)
treeb2d1abbae5e2e0700ccfffed17fd956b6a380e08
parentb5accbb0dfae36d8d36cd882096943c98d5ede15 (diff)
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>
-rw-r--r--fs/orangefs/acl.c29
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:
119int orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type) 119int orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
120{ 120{
121 int error; 121 int error;
122 struct iattr iattr;
123 int rc;
122 124
123 if (type == ACL_TYPE_ACCESS && acl) { 125 if (type == ACL_TYPE_ACCESS && acl) {
124 umode_t mode; 126 /*
125 127 * posix_acl_update_mode checks to see if the permissions
126 error = posix_acl_update_mode(inode, &mode, &acl); 128 * described by the ACL can be encoded into the
129 * object's mode. If so, it sets "acl" to NULL
130 * and "mode" to the new desired value. It is up to
131 * us to propagate the new mode back to the server...
132 */
133 error = posix_acl_update_mode(inode, &iattr.ia_mode, &acl);
127 if (error) { 134 if (error) {
128 gossip_err("%s: posix_acl_update_mode err: %d\n", 135 gossip_err("%s: posix_acl_update_mode err: %d\n",
129 __func__, 136 __func__,
@@ -131,12 +138,18 @@ int orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
131 return error; 138 return error;
132 } 139 }
133 140
134 if (inode->i_mode != mode) 141 if (acl) {
135 SetModeFlag(ORANGEFS_I(inode)); 142 rc = __orangefs_set_acl(inode, acl, type);
136 inode->i_mode = mode; 143 } else {
137 mark_inode_dirty_sync(inode); 144 iattr.ia_valid = ATTR_MODE;
145 rc = orangefs_inode_setattr(inode, &iattr);
146 }
147
148 return rc;
149
150 } else {
151 return -EINVAL;
138 } 152 }
139 return __orangefs_set_acl(inode, acl, type);
140} 153}
141 154
142int orangefs_init_acl(struct inode *inode, struct inode *dir) 155int orangefs_init_acl(struct inode *inode, struct inode *dir)