public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] NFSD: offer write delegation for OPEN with OPEN4_SHARE_ACCESS only
@ 2025-02-13 19:37 Dai Ngo
  2025-02-13 19:37 ` [PATCH 1/2] NFSD: Offer write delegation for OPEN with OPEN4_SHARE_ACCESS_WRITE only Dai Ngo
  2025-02-13 19:37 ` [PATCH 2/2] NFSD: allow client to use write delegation stateid for READ Dai Ngo
  0 siblings, 2 replies; 8+ messages in thread
From: Dai Ngo @ 2025-02-13 19:37 UTC (permalink / raw)
  To: chuck.lever, jlayton, neilb, okorniev, tom; +Cc: linux-nfs, sagi

RFC8881 does not explicitly state that server must grant write delegation
to OPEN with OPEN4_SHARE_ACCESS_WRITE only. However there are text in the
RFC that implies it is up to the server implementation to offer write
delegation for OPEN with OPEN4_SHARE_ACCESS_WRITE only.

Section 9.1.2:

  "In the case of READ, the server may perform the corresponding
   check on the access mode, or it may choose to allow READ for
   OPEN4_SHARE_ACCESS_WRITE, to accommodate clients whose WRITE
   implementation may unavoidably do (e.g., due to buffer cache
   constraints)."

Also in section 10.4.1

  "Similarly, when closing a file opened for OPEN4_SHARE_ACCESS_WRITE/
   OPEN4_SHARE_ACCESS_BOTH and if an OPEN_DELEGATE_WRITE delegation
   is in effect"

This patch series offers write delegation for OPEN with OPEN4_SHARE_ACCESS_WRITE
only. When this condition is detected in nfsd4_encode_read the access mode
FMODE_READ is temporarily added to the file's f_mode and is removed when
the read is done.

 fs/nfsd/nfs4proc.c  | 15 ++++++++++++++-
 fs/nfsd/nfs4state.c | 34 +++++++++++++---------------------
 fs/nfsd/nfs4xdr.c   |  8 ++++++++
 fs/nfsd/xdr4.h      |  1 +
 4 files changed, 36 insertions(+), 22 deletions(-)


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-02-14 19:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-13 19:37 [PATCH 0/2] NFSD: offer write delegation for OPEN with OPEN4_SHARE_ACCESS only Dai Ngo
2025-02-13 19:37 ` [PATCH 1/2] NFSD: Offer write delegation for OPEN with OPEN4_SHARE_ACCESS_WRITE only Dai Ngo
2025-02-13 19:37 ` [PATCH 2/2] NFSD: allow client to use write delegation stateid for READ Dai Ngo
2025-02-13 21:07   ` Jeff Layton
2025-02-13 23:29     ` Jeff Layton
2025-02-14 14:26       ` Chuck Lever
2025-02-14 18:24         ` Dai Ngo
2025-02-14 19:19           ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox