]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sunrpc: start cache request seqno at 1 to fix netlink GET_REQS
authorJeff Layton <jlayton@kernel.org>
Sat, 11 Apr 2026 21:12:16 +0000 (17:12 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Sun, 10 May 2026 16:41:08 +0000 (12:41 -0400)
sunrpc_cache_requests_snapshot() filters requests with
crq->seqno <= min_seqno. The min_seqno for the first netlink
dump call is cb->args[0] which is 0. Since next_seqno was
initialized to 0, the very first cache request got seqno=0
and was silently skipped by the snapshot (0 <= 0 is true).

This caused netlink-based GET_REQS to return 0 pending requests
even when a request was queued, preventing mountd from resolving
cache entries (particularly expkey/nfsd.fh). The unresolved
CACHE_PENDING state blocked all further notifications for the
entry, leading to permanent NFS4ERR_DELAY hangs.

Start next_seqno at 1 so all requests have seqno >= 1 and pass
the snapshot filter when min_seqno is 0.

Fixes: facc4e3c8042 ("sunrpc: split cache_detail queue into request and reader lists")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/cache.c

index 7081c1214e6c3226f8ac82c8bc7ff6c36f598744..b5474ce534fb9d3189f72aa76bc7075286e04b8c 100644 (file)
@@ -403,7 +403,7 @@ void sunrpc_init_cache_detail(struct cache_detail *cd)
        INIT_LIST_HEAD(&cd->readers);
        spin_lock_init(&cd->queue_lock);
        init_waitqueue_head(&cd->queue_wait);
-       cd->next_seqno = 0;
+       cd->next_seqno = 1;
        spin_lock(&cache_list_lock);
        cd->nextcheck = 0;
        cd->entries = 0;