summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2014-02-02 14:36:42 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-02-03 13:14:23 -0500
commit8f493b9cfcd8941c6b27d6ce8e3b4a78c094b3c1 (patch)
tree2e0bfe6f30c6763b23e93bec290ac4674ec95a7c /fs/nfs
parentd4c42fb493e018e9240810bb6dc5334ae0505145 (diff)
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>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs3acl.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c
index 9271a6bb9a41..871d6eda8dba 100644
--- a/fs/nfs/nfs3acl.c
+++ b/fs/nfs/nfs3acl.c
@@ -113,7 +113,7 @@ getout:
113 return ERR_PTR(status); 113 return ERR_PTR(status);
114} 114}
115 115
116int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, 116static 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
201int 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
201int nfs3_set_acl(struct inode *inode, struct posix_acl *acl, int type) 210int 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