Commit 8f493b9cfcd8941c6b27d6ce8e3b4a78c094b3c1
1 parent
d4c42fb493
Exists in
master
and in
16 other branches
NFSv3: Fix return value of nfs3_proc_setacls
nfs3_proc_setacls is used internally by the NFSv3 create operations to set the acl after the file has been created. If the operation fails because the server doesn't support acls, then it must return '0', not -EOPNOTSUPP. Reported-by: Russell King <linux@arm.linux.org.uk> Link: http://lkml.kernel.org/r/20140201010328.GI15937@n2100.arm.linux.org.uk Cc: Christoph Hellwig <hch@lst.de> Tested-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Showing 1 changed file with 11 additions and 2 deletions Side-by-side Diff
fs/nfs/nfs3acl.c
... | ... | @@ -113,7 +113,7 @@ |
113 | 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 | 117 | struct posix_acl *dfacl) |
118 | 118 | { |
119 | 119 | struct nfs_server *server = NFS_SERVER(inode); |
... | ... | @@ -198,6 +198,15 @@ |
198 | 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 | 210 | int nfs3_set_acl(struct inode *inode, struct posix_acl *acl, int type) |
202 | 211 | { |
203 | 212 | struct posix_acl *alloc = NULL, *dfacl = NULL; |
... | ... | @@ -225,7 +234,7 @@ |
225 | 234 | if (IS_ERR(alloc)) |
226 | 235 | goto fail; |
227 | 236 | } |
228 | - status = nfs3_proc_setacls(inode, acl, dfacl); | |
237 | + status = __nfs3_proc_setacls(inode, acl, dfacl); | |
229 | 238 | posix_acl_release(alloc); |
230 | 239 | return status; |
231 | 240 |