NFSv3: Fix another acl regression
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 24 Aug 2014 18:46:48 +0000 (14:46 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 26 Aug 2014 20:17:48 +0000 (16:17 -0400)
When creating a new object on the NFS server, we should not be sending
posix setacl requests unless the preceding posix_acl_create returned a
non-trivial acl. Doing so, causes Solaris servers in particular to
return an EINVAL.

Fixes: 013cdf1088d72 (nfs: use generic posix ACL infrastructure,,,)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1132786
Cc: stable@vger.kernel.org # 3.14+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/nfs3acl.c

index d0fec260132add4ce0d8917cd1bb47c15408be90..24c6898159cc1ea5e2622574968ff1bbf62268b5 100644 (file)
@@ -129,7 +129,10 @@ static int __nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
                .rpc_argp       = &args,
                .rpc_resp       = &fattr,
        };
-       int status;
+       int status = 0;
+
+       if (acl == NULL && (!S_ISDIR(inode->i_mode) || dfacl == NULL))
+               goto out;
 
        status = -EOPNOTSUPP;
        if (!nfs_server_capable(inode, NFS_CAP_ACLS))