mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: "zhangjian (CG)" <zhangjian496@huawei.com>,
	Trond Myklebust <trondmy@kernel.org>,
	anna@kernel.org
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [Question]nfs: never returned delegation
Date: Mon, 11 Aug 2025 09:03:49 -0400	[thread overview]
Message-ID: <850dcbf562b7eb5848278937092d2d8511eb648f.camel@kernel.org> (raw)
In-Reply-To: <ff8debe9-6877-4cf7-ba29-fc98eae0ffa0@huawei.com>

On Mon, 2025-08-11 at 20:48 +0800, zhangjian (CG) wrote:
> Recently, we meet a NFS problem in 5.10. There are so many test_state_id request after a non-privilaged request in tcpdump result. There are 40w+ delegations in client (I read the delegation list from /proc/kcore).
> Firstly, I think state manager cost a lot in nfs_server_reap_expired_delegations. But I see they are all in NFS_DELEGATION_REVOKED state except 6 in NFS_DELEGATION_REFERENCED (I read this from /proc/kcore too). 
> I analyze NFS code and find if NFSPROC4_CLNT_DELEGRETURN procedure meet ETIMEOUT, delegation will be marked as NFS4ERR_DELEG_REVOKED and never return it again. NFS server will keep the revoked delegation in clp->cl_revoked forever. This will result in following sequence response with RECALLABLE_STATE_REVOKED flag. Client will send test_state_id request for all non-revoked delegation.
> This can only be solved by restarting NFS server.
> I think ETIMEOUT in NFSPROC4_CLNT_DELEGRETURN procedure may be not the only case that cause lots of non-terminable test_state_id requests after any non-privilaged request. 
> Wish NFS experts give some advices on this problem.
> 

What should happen is that the client should issue a TEST_STATEID and
then follow up with a FREE_STATEID once it's clear that it has been
revoked. Alternately, if the client expires then the server will purge
any state it held at that point. The server is required to keep a
record of these objects until one of those events occurs.

v5.10 is pretty old, and there have been a number of fixes in this area
in both the client and server over the last several years. You may want
to try a newer kernel (or look at doing some backporting).

Cheers,
-- 
Jeff Layton <jlayton@kernel.org>

  parent reply	other threads:[~2025-08-11 13:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-11 12:48 zhangjian (CG)
2025-08-11 13:03 ` Trond Myklebust
2025-08-12  2:51   ` zhangjian (CG)
2025-09-01  9:07   ` Li Lingfeng
2025-09-01 11:40     ` Jeff Layton
2025-09-01 14:12       ` Li Lingfeng
2025-08-11 13:03 ` Jeff Layton [this message]
2025-08-11 13:06   ` Trond Myklebust
2025-08-12  2:45   ` zhangjian (CG)
2026-03-06  2:46     ` zhangjian (CG)
2026-03-06  4:49       ` Trond Myklebust
2026-03-12  4:19         ` [Question]nfs: should nfs timeout even with NFS_CS_NO_RETRANS_TIMEOUT ? zhangjian (CG)
2026-03-12 13:09           ` Trond Myklebust
2026-03-13  3:22             ` zhangjian (CG)
2026-03-13 15:18               ` Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=850dcbf562b7eb5848278937092d2d8511eb648f.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=anna@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@kernel.org \
    --cc=zhangjian496@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome