NFS: Move the delegation return down into _nfs4_do_setattr()
authorTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 20 Mar 2018 20:43:18 +0000 (16:43 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 10 Apr 2018 20:06:22 +0000 (16:06 -0400)
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/inode.c
fs/nfs/nfs4proc.c

index 7d89354..9da00b2 100644 (file)
@@ -613,11 +613,6 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr)
                goto out;
        }
 
-       /*
-        * Return any delegations if we're going to change ACLs
-        */
-       if ((attr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)) != 0)
-               NFS_PROTO(inode)->return_delegation(inode);
        error = NFS_PROTO(inode)->setattr(dentry, fattr, attr);
        if (error == 0)
                error = nfs_refresh_inode(inode, fattr);
index 21daeac..173089f 100644 (file)
@@ -3875,6 +3875,10 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
        if (IS_ERR(label))
                return PTR_ERR(label);
 
+       /* Return any delegations if we're going to change ACLs */
+       if ((sattr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)) != 0)
+               nfs4_inode_return_delegation(inode);
+
        status = nfs4_do_setattr(inode, cred, fattr, sattr, ctx, NULL, label);
        if (status == 0) {
                nfs_setattr_update_inode(inode, sattr, fattr);