summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDai Ngo <dai.ngo@oracle.com>2024-10-08 15:58:07 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-11-08 16:25:53 +0100
commit9ce8e1d7ef459ae5f3d156603a48b304cd680119 (patch)
tree47c79ec03eb1d8e7116000affe5ff562eea160ac
parentcb1711e65bff0ff31be410d1258fa54253074065 (diff)
downloadlinux-9ce8e1d7ef459ae5f3d156603a48b304cd680119.tar.gz
linux-9ce8e1d7ef459ae5f3d156603a48b304cd680119.tar.bz2
linux-9ce8e1d7ef459ae5f3d156603a48b304cd680119.zip
NFS: remove revoked delegation from server's delegation list
[ Upstream commit 7ef60108069b7e3cc66432304e1dd197d5c0a9b5 ] After the delegation is returned to the NFS server remove it from the server's delegations list to reduce the time it takes to scan this list. Network trace captured while running the below script shows the time taken to service the CB_RECALL increases gradually due to the overhead of traversing the delegation list in nfs_delegation_find_inode_server. The NFS server in this test is a Solaris server which issues CB_RECALL when receiving the all-zero stateid in the SETATTR. mount=/mnt/data for i in $(seq 1 20) do echo $i mkdir $mount/testtarfile$i time tar -C $mount/testtarfile$i -xf 5000_files.tar done Signed-off-by: Dai Ngo <dai.ngo@oracle.com> Reviewed-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/nfs/delegation.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 8124d4f8b29a..ac79ef0d43a7 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -981,6 +981,11 @@ void nfs_delegation_mark_returned(struct inode *inode,
}
nfs_mark_delegation_revoked(delegation);
+ clear_bit(NFS_DELEGATION_RETURNING, &delegation->flags);
+ spin_unlock(&delegation->lock);
+ if (nfs_detach_delegation(NFS_I(inode), delegation, NFS_SERVER(inode)))
+ nfs_put_delegation(delegation);
+ goto out_rcu_unlock;
out_clear_returning:
clear_bit(NFS_DELEGATION_RETURNING, &delegation->flags);