]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
NFS: rewrite nfs_delegations_present in terms of nr_active_delegations
authorChristoph Hellwig <hch@lst.de>
Wed, 7 Jan 2026 07:27:03 +0000 (08:27 +0100)
committerAnna Schumaker <anna.schumaker@oracle.com>
Tue, 20 Jan 2026 19:49:46 +0000 (14:49 -0500)
Renewal only cares for active delegations and not revoked ones.  Replace
the list empty check with reading the active delegation counter to
implement this.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
fs/nfs/delegation.c

index f56b1d29650a1fb038f8658882793ab893bc75b1..8e5cb8fc3f323bce6803863fcd9598bcd21d3be0 100644 (file)
@@ -1453,7 +1453,7 @@ int nfs_delegations_present(struct nfs_client *clp)
 
        rcu_read_lock();
        list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link)
-               if (!list_empty(&server->delegations)) {
+               if (atomic_long_read(&server->nr_active_delegations) > 0) {
                        ret = 1;
                        break;
                }