Linux NFS development
 help / color / mirror / Atom feed
From: Chuck Lever <cel@kernel.org>
To: Chuck Lever <cel@kernel.org>, Jeff Layton <jlayton@kernel.org>,
	 NeilBrown <neil@brown.name>,
	Olga Kornievskaia <okorniev@redhat.com>,
	 Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 0/5] NFSD: Fixes for OPEN4_SHARE_ACCESS_WANT handling
Date: Thu, 08 Oct 2026 14:18:26 -0400	[thread overview]
Message-ID: <20261008-want-read-v1-0-e372262857c8@kernel.org> (raw)

A client that uses OPEN(CLAIM_FH) with OPEN4_SHARE_ACCESS_WANT_READ_DELEG
to regain a delegation on a file the client already has open gets no
delegation from NFSD (https://github.com/linux-nfs/nfsd/issues/156).
The report carries no ond_why value, and currently NFSD does not
supply a useful one. nfs4_open_delegation() discards the errno from
nfs4_set_delegation(), so every refusal reports WND4_RESOURCE, and
the WANT_CANCEL and upgrade/downgrade cases in the reply code are
unreachable.

The -EAGAIN return of nfs4_set_delegation() is narrowed to mean
contention before the recall Bloom filter is mapped onto it
(patches 2 and 3). Patch 3 has no effect without patch 2, so patch 3
carries no Fixes: tag. The last patch changes what NFSD grants rather
than what it reports, matching what the FreeBSD server grants.

After this series, NFSD still reports WND4_RESOURCE while in grace,
while the backchannel is down, and for a want of the delegation type
the client already holds, for which RFC 8881 defines no ond_why
value. NFSD also still grants no delegation on a file after a recall
for as long as any client keeps the file open, now reported as
WND4_CONTENTION. Whether the reporter's client hit that policy is
unknown. Relaxing the policy and/or implementing access mode upgrade
and downgrade is left as future work.

The pynfs NFSv4.1 "deleg" tests pass 24 or 24, including the tests
that exercise ond_why and WANT_READ_DELEG on a read-write OPEN. The
NFSv4.0 delegations and writedelegations flags were run without the
five tests that need a manual operation on the
server. DELEG22 fails and the seven write-delegation tests warn
because NFSD grants no delegation to an NFSv4.0 client that opens for
write. DELEG6 and REBT8 fail in code this series does not change.

---
Chuck Lever (5):
      NFSD: Report WND4_CANCELLED for an OPEN with WANT_CANCEL
      NFSD: Report the correct value in an OPEN response's ond_why field
      NFSD: Report WND4_CONTENTION for a recently recalled file
      NFSD: Report unsupported delegation upgrade and downgrade
      NFSD: Honor OPEN4_SHARE_ACCESS_WANT_READ_DELEG on a read-write OPEN

 fs/nfsd/nfs4state.c | 128 +++++++++++++++++++++++++++++-----------------------
 1 file changed, 71 insertions(+), 57 deletions(-)
---
base-commit: 97bf905e837e345107c2ed3efb2e65108e081e0e
change-id: 20261007-want-read-3a08fd18881c

Best regards,
--  
Chuck Lever <cel@kernel.org>


             reply	other threads:[~2026-10-08 18:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08 18:18 Chuck Lever [this message]
2026-10-08 18:18 ` [PATCH 1/5] NFSD: Report WND4_CANCELLED for an OPEN with WANT_CANCEL Chuck Lever
2026-10-08 18:18 ` [PATCH 2/5] NFSD: Report the correct value in an OPEN response's ond_why field Chuck Lever
2026-10-08 18:18 ` [PATCH 3/5] NFSD: Report WND4_CONTENTION for a recently recalled file Chuck Lever
2026-10-08 18:18 ` [PATCH 4/5] NFSD: Report unsupported delegation upgrade and downgrade Chuck Lever
2026-10-08 18:18 ` [PATCH 5/5] NFSD: Honor OPEN4_SHARE_ACCESS_WANT_READ_DELEG on a read-write OPEN Chuck Lever

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=20261008-want-read-v1-0-e372262857c8@kernel.org \
    --to=cel@kernel.org \
    --cc=Dai.Ngo@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.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