diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-02-03 17:13:45 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-02-03 17:13:45 -0500 |
commit | 88a78a912ee059467ae6db7429a6efe4654620a5 (patch) | |
tree | f6ac63e297102d1532601548e6d939a7104356c6 /fs/nfs | |
parent | 20b9a9024540a775395d5d1f41eec0ec6ec41f9b (diff) | |
parent | 789b663ae3d427ea9c50505339a13276e7228c9d (diff) |
Merge branch 'acl_fixes' into linux-next
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs3acl.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c index 9a5ca03fa539..871d6eda8dba 100644 --- a/fs/nfs/nfs3acl.c +++ b/fs/nfs/nfs3acl.c | |||
@@ -80,7 +80,7 @@ struct posix_acl *nfs3_get_acl(struct inode *inode, int type) | |||
80 | } | 80 | } |
81 | 81 | ||
82 | if (res.acl_access != NULL) { | 82 | if (res.acl_access != NULL) { |
83 | if (posix_acl_equiv_mode(res.acl_access, NULL) || | 83 | if ((posix_acl_equiv_mode(res.acl_access, NULL) == 0) || |
84 | res.acl_access->a_count == 0) { | 84 | res.acl_access->a_count == 0) { |
85 | posix_acl_release(res.acl_access); | 85 | posix_acl_release(res.acl_access); |
86 | res.acl_access = NULL; | 86 | res.acl_access = NULL; |
@@ -113,7 +113,7 @@ getout: | |||
113 | return ERR_PTR(status); | 113 | return ERR_PTR(status); |
114 | } | 114 | } |
115 | 115 | ||
116 | int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, | 116 | static int __nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, |
117 | struct posix_acl *dfacl) | 117 | struct posix_acl *dfacl) |
118 | { | 118 | { |
119 | struct nfs_server *server = NFS_SERVER(inode); | 119 | struct nfs_server *server = NFS_SERVER(inode); |
@@ -198,6 +198,15 @@ out: | |||
198 | return status; | 198 | return status; |
199 | } | 199 | } |
200 | 200 | ||
201 | int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, | ||
202 | struct posix_acl *dfacl) | ||
203 | { | ||
204 | int ret; | ||
205 | ret = __nfs3_proc_setacls(inode, acl, dfacl); | ||
206 | return (ret == -EOPNOTSUPP) ? 0 : ret; | ||
207 | |||
208 | } | ||
209 | |||
201 | int nfs3_set_acl(struct inode *inode, struct posix_acl *acl, int type) | 210 | int nfs3_set_acl(struct inode *inode, struct posix_acl *acl, int type) |
202 | { | 211 | { |
203 | struct posix_acl *alloc = NULL, *dfacl = NULL; | 212 | struct posix_acl *alloc = NULL, *dfacl = NULL; |
@@ -225,7 +234,7 @@ int nfs3_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
225 | if (IS_ERR(alloc)) | 234 | if (IS_ERR(alloc)) |
226 | goto fail; | 235 | goto fail; |
227 | } | 236 | } |
228 | status = nfs3_proc_setacls(inode, acl, dfacl); | 237 | status = __nfs3_proc_setacls(inode, acl, dfacl); |
229 | posix_acl_release(alloc); | 238 | posix_acl_release(alloc); |
230 | return status; | 239 | return status; |
231 | 240 | ||
@@ -233,25 +242,6 @@ fail: | |||
233 | return PTR_ERR(alloc); | 242 | return PTR_ERR(alloc); |
234 | } | 243 | } |
235 | 244 | ||
236 | int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, | ||
237 | umode_t mode) | ||
238 | { | ||
239 | struct posix_acl *default_acl, *acl; | ||
240 | int error; | ||
241 | |||
242 | error = posix_acl_create(dir, &mode, &default_acl, &acl); | ||
243 | if (error) | ||
244 | return (error == -EOPNOTSUPP) ? 0 : error; | ||
245 | |||
246 | error = nfs3_proc_setacls(inode, acl, default_acl); | ||
247 | |||
248 | if (acl) | ||
249 | posix_acl_release(acl); | ||
250 | if (default_acl) | ||
251 | posix_acl_release(default_acl); | ||
252 | return error; | ||
253 | } | ||
254 | |||
255 | const struct xattr_handler *nfs3_xattr_handlers[] = { | 245 | const struct xattr_handler *nfs3_xattr_handlers[] = { |
256 | &posix_acl_access_xattr_handler, | 246 | &posix_acl_access_xattr_handler, |
257 | &posix_acl_default_xattr_handler, | 247 | &posix_acl_default_xattr_handler, |