From 86ac1b7b616bbc33f886882655d31068f0b14b8d Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 7 Jan 2026 08:27:00 +0100 Subject: [PATCH] NFS: remove NFS_DELEGATION_INODE_FREEING This essentially reverts commit 6f9449be53f3 ("NFS: Fix a soft lockup in the delegation recovery code") because the code walking the per-server delegation list has been fixed to just skip inodes for which nfs_delegation_grab_inode fails, instead of having to restart the entire series in commit f92214e4c312 ("NFS: Avoid unnecessary rescanning of the per-server delegation list"). Signed-off-by: Christoph Hellwig Signed-off-by: Anna Schumaker --- fs/nfs/delegation.c | 13 ++----------- fs/nfs/delegation.h | 1 - fs/nfs/nfs4trace.h | 1 - 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 47ecf67ace91e..7b05d661775bb 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c @@ -308,8 +308,6 @@ static struct inode *nfs_delegation_grab_inode(struct nfs_delegation *delegation spin_lock(&delegation->lock); if (delegation->inode != NULL) inode = igrab(delegation->inode); - if (!inode) - set_bit(NFS_DELEGATION_INODE_FREEING, &delegation->flags); spin_unlock(&delegation->lock); return inode; } @@ -643,8 +641,6 @@ restart: list_for_each_entry_from_rcu(delegation, &server->delegations, super_list) { struct inode *to_put = NULL; - if (test_bit(NFS_DELEGATION_INODE_FREEING, &delegation->flags)) - continue; if (!nfs_delegation_need_return(delegation)) { if (nfs4_is_valid_delegation(delegation, 0)) prev = delegation; @@ -765,7 +761,6 @@ void nfs_inode_evict_delegation(struct inode *inode) return; set_bit(NFS_DELEGATION_RETURNING, &delegation->flags); - set_bit(NFS_DELEGATION_INODE_FREEING, &delegation->flags); nfs_do_return_delegation(inode, delegation, 1); nfs_free_delegation(server, delegation); } @@ -1253,9 +1248,7 @@ static int nfs_server_reap_unclaimed_delegations(struct nfs_server *server, restart: rcu_read_lock(); list_for_each_entry_rcu(delegation, &server->delegations, super_list) { - if (test_bit(NFS_DELEGATION_INODE_FREEING, - &delegation->flags) || - test_bit(NFS_DELEGATION_RETURNING, + if (test_bit(NFS_DELEGATION_RETURNING, &delegation->flags) || test_bit(NFS_DELEGATION_NEED_RECLAIM, &delegation->flags) == 0) @@ -1390,9 +1383,7 @@ static int nfs_server_reap_expired_delegations(struct nfs_server *server, restart: rcu_read_lock(); list_for_each_entry_rcu(delegation, &server->delegations, super_list) { - if (test_bit(NFS_DELEGATION_INODE_FREEING, - &delegation->flags) || - test_bit(NFS_DELEGATION_RETURNING, + if (test_bit(NFS_DELEGATION_RETURNING, &delegation->flags) || test_bit(NFS_DELEGATION_TEST_EXPIRED, &delegation->flags) == 0 || diff --git a/fs/nfs/delegation.h b/fs/nfs/delegation.h index 46d866adb5c26..fef1f4126e8f3 100644 --- a/fs/nfs/delegation.h +++ b/fs/nfs/delegation.h @@ -37,7 +37,6 @@ enum { NFS_DELEGATION_RETURNING, NFS_DELEGATION_REVOKED, NFS_DELEGATION_TEST_EXPIRED, - NFS_DELEGATION_INODE_FREEING, NFS_DELEGATION_RETURN_DELAYED, NFS_DELEGATION_DELEGTIME, }; diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h index 6285128e631a5..18d02b4715bb5 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -996,7 +996,6 @@ DEFINE_NFS4_SET_DELEGATION_EVENT(nfs4_detach_delegation); { BIT(NFS_DELEGATION_RETURNING), "RETURNING" }, \ { BIT(NFS_DELEGATION_REVOKED), "REVOKED" }, \ { BIT(NFS_DELEGATION_TEST_EXPIRED), "TEST_EXPIRED" }, \ - { BIT(NFS_DELEGATION_INODE_FREEING), "INODE_FREEING" }, \ { BIT(NFS_DELEGATION_RETURN_DELAYED), "RETURN_DELAYED" }) DECLARE_EVENT_CLASS(nfs4_delegation_event, -- 2.47.3