From 25dde935988bc0cc2991cedbea90a2ce65066d54 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Fri, 11 Sep 2026 11:00:02 -0400 Subject: [PATCH] NFSv4: Fix a regression in the handling of CB_RECALL_ANY When the flag NFS_DELEGATION_RETURN was replaced by the server->delegations_return list, the test in nfs_mark_return_if_closed_delegation() was replaced by one that stops all further marking of delegations for return when closed as soon as the server->delegations_return list is non-empty, breaking CB_RECALL_ANY behaviour. While the intention at the time was probably to check if delegation->entry was non-empty in order to emulate the effect of the NFS_DELEGATION_RETURN test, that is no longer an option, since delegation->entry is also used for the LRU list. By just removing the offending check altogether, the patch can end up moving delegations from the server->delegations_delayed list prematurely, triggering an early retry. However that should be mostly harmless behaviour. Fixes: 0ebe655bd033 ("NFS: add a separate delegation return list") Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Trond Myklebust --- fs/nfs/delegation.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index ab3e441464a6..ad774316f716 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c @@ -934,8 +934,7 @@ nfs_mark_return_if_closed_delegation(struct nfs_server *server, { struct inode *inode; - if (!list_empty_careful(&server->delegations_return) || - test_bit(NFS_DELEGATION_RETURN_IF_CLOSED, &delegation->flags)) + if (test_bit(NFS_DELEGATION_RETURN_IF_CLOSED, &delegation->flags)) return; spin_lock(&delegation->lock); inode = delegation->inode;