linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] nfsd: nfserr_jukebox in nlm_fopen should lead to a retry
@ 2025-08-12 16:03 Olga Kornievskaia
  2025-08-12 16:03 ` [PATCH v2 2/2] lockd: while grace prefer to fail with nlm_lck_denied_grace_period Olga Kornievskaia
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Olga Kornievskaia @ 2025-08-12 16:03 UTC (permalink / raw)
  To: chuck.lever, jlayton; +Cc: linux-nfs, neil, Dai.Ngo, tom

When v3 NLM request finds a conflicting delegation, it triggers
a delegation recall and nfsd_open fails with EAGAIN. nfsd_open
then translates EAGAIN into nfserr_jukebox. In nlm_fopen, instead
of returning nlm_failed for when there is a conflicting delegation,
drop this NLM request so that the client retries. Once delegation
is recalled and if a local lock is claimed, a retry would lead to
nfsd returning a nlm_lck_blocked error or a successful nlm lock.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
---
 fs/nfsd/lockd.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c
index edc9f75dc75c..8fdc769d392e 100644
--- a/fs/nfsd/lockd.c
+++ b/fs/nfsd/lockd.c
@@ -57,6 +57,20 @@ nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file **filp,
 	switch (nfserr) {
 	case nfs_ok:
 		return 0;
+	case nfserr_jukebox:
+		/* this error can indicate a presence of a conflicting
+		 * delegation to an NLM lock request. Options are:
+		 * (1) For now, drop this request and make the client
+		 * retry. When delegation is returned, client's retry will
+		 * complete.
+		 * (2) NLM4_DENIED as per "spec" signals to the client
+		 * that the lock is unavaiable now but client can retry.
+		 * Linux client implementation does not. It treats
+		 * NLM4_DENIED same as NLM4_FAILED and errors the request.
+		 * (3) For the future, treat this as blocked lock and try
+		 * to callback when the delegation is returned but might
+		 * not have a proper lock request to block on.
+		 */
 	case nfserr_dropit:
 		return nlm_drop_reply;
 	case nfserr_stale:
-- 
2.47.1


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

end of thread, other threads:[~2025-08-25 15:24 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-12 16:03 [PATCH v2 1/2] nfsd: nfserr_jukebox in nlm_fopen should lead to a retry Olga Kornievskaia
2025-08-12 16:03 ` [PATCH v2 2/2] lockd: while grace prefer to fail with nlm_lck_denied_grace_period Olga Kornievskaia
2025-08-12 23:49   ` NeilBrown
2025-08-13 15:32     ` Olga Kornievskaia
2025-08-20 23:15       ` NeilBrown
2025-08-21 13:56         ` Olga Kornievskaia
2025-08-21 14:01           ` Chuck Lever
2025-08-21 15:09           ` Chuck Lever
2025-08-21 18:20             ` Olga Kornievskaia
2025-08-21 18:24               ` Chuck Lever
2025-08-21 18:33                 ` Olga Kornievskaia
2025-08-21 18:39                   ` Chuck Lever
2025-08-21 18:51                     ` Olga Kornievskaia
2025-08-21 19:15                     ` Olga Kornievskaia
2025-08-25 15:23           ` Olga Kornievskaia
2025-08-12 17:23 ` [PATCH v2 1/2] nfsd: nfserr_jukebox in nlm_fopen should lead to a retry Chuck Lever
2025-08-21 19:18 ` Chuck Lever
2025-08-21 19:28   ` Olga Kornievskaia
2025-08-21 19:44     ` Olga Kornievskaia
2025-08-21 19:44     ` Chuck Lever
2025-08-21 19:57       ` Olga Kornievskaia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).