Commit 173d76aa authored by Trond Myklebust's avatar Trond Myklebust Committed by Jiri Slaby

NFSv3: Fix return value of nfs3_proc_setacls

commit 8f493b9c upstream.

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: default avatarRussell 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: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Acked-by: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 0eec4308
......@@ -289,8 +289,8 @@ struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type)
return acl;
}
static int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
struct posix_acl *dfacl)
static int __nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
struct posix_acl *dfacl)
{
struct nfs_server *server = NFS_SERVER(inode);
struct nfs_fattr *fattr;
......@@ -373,6 +373,15 @@ static int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
return status;
}
int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
struct posix_acl *dfacl)
{
int ret;
ret = __nfs3_proc_setacls(inode, acl, dfacl);
return (ret == -EOPNOTSUPP) ? 0 : ret;
}
int nfs3_proc_setacl(struct inode *inode, int type, struct posix_acl *acl)
{
struct posix_acl *alloc = NULL, *dfacl = NULL;
......@@ -406,7 +415,7 @@ int nfs3_proc_setacl(struct inode *inode, int type, struct posix_acl *acl)
if (IS_ERR(alloc))
goto fail;
}
status = nfs3_proc_setacls(inode, acl, dfacl);
status = __nfs3_proc_setacls(inode, acl, dfacl);
posix_acl_release(alloc);
return status;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment