NFS: Move the delegation return down into nfs4_proc_link()
authorTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 20 Mar 2018 20:43:14 +0000 (16:43 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 10 Apr 2018 20:06:22 +0000 (16:06 -0400)
Move the delegation return out of generic code.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/dir.c
fs/nfs/nfs4proc.c

index 2f3f867..b4549e5 100644 (file)
@@ -1932,8 +1932,6 @@ nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
                old_dentry, dentry);
 
        trace_nfs_link_enter(inode, dir, dentry);
-       NFS_PROTO(inode)->return_delegation(inode);
-
        d_drop(dentry);
        error = NFS_PROTO(dir)->link(inode, dir, &dentry->d_name);
        if (error == 0) {
index 71f2916..f4216b6 100644 (file)
@@ -4318,6 +4318,8 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct
        }
        arg.bitmask = nfs4_bitmask(server, res.label);
 
+       nfs4_inode_return_delegation(inode);
+
        status = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, &res.seq_res, 1);
        if (!status) {
                update_changeattr(dir, &res.cinfo, res.fattr->time_start);