linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] nfsd/lockd: v3/v4 lock conflict in presence of delegations
@ 2025-08-11 18:18 Olga Kornievskaia
  2025-08-11 18:18 ` [RFC PATCH 1/2] nfsd: nfserr_jukebox in nlm_fopen should lead to a retry Olga Kornievskaia
  2025-08-11 18:18 ` [RFC PATCH 2/2] lockd: while grace prefer to fail with nlm_lck_denied_grace_period Olga Kornievskaia
  0 siblings, 2 replies; 10+ messages in thread
From: Olga Kornievskaia @ 2025-08-11 18:18 UTC (permalink / raw)
  To: chuck.lever, jlayton; +Cc: linux-nfs, neil, Dai.Ngo, tom

Hi folks,

I see that an NLM lock request when another client holds a delegation
triggers a delegation recall on the server. Is that normal?

Let's say it is normal. Such an NLM lock request fails with
"nlm_failed". Alternatively, if another client doesn't have a
delegation but holds a lock, NLM request gets nlm_blocked and gets a
callback. It seems incorrect that just holding a delegation would
prevent somebody from getting lock?

I believe the reason NLM v3 request (while there is a conflicting
delegation) fails is because break_lease returns -EAGAIN error and
nfsd_open calls nfserrno() which maps it into err_jukebox which gets
propagated to nlm_fopen() which maps any error (other than stale or
drop_it) to nlm_failed. Should nlm_fopen() have mapped jukebox error
into dropit (so that the client tries the lock again?).

Now, let me tie this to a server reboot. Why isn't nlm4svc_prov_lock()
checkin that it's in grace first thing before doing anything further?
When that v3 lock request arrives (during grace) when there is a v4
delegation given out, it prevents the server from triggering a
delegation recall (while in grace) and causing issues of failing the
lock. But I guess it's wasteful if there no conflicts.

Attached to this email disguised as a cover letter to a patch series
are 2 patches where I attempt to address the problem is a failing
NLM lock in presence of a v4 delegation.

I asked about NLM request triggering a delegation recall being normal
because during grace period, when v3 lock comes in and triggers a
delegation recall, the client sends local LOCK request (note it's no
a reclaim-lock because the client sent its RECLAIM_COMPLETE as it was
given a delegation), now this LOCK is failed with ERR_GRACE and the
client can't handle it. Be it a client issue for which I'm sending 
a separate patch. But it all revolves around the issue of whether
or not delegation recalls can happen during grace.

Olga Kornievskaia (2):
  nfsd: nfserr_jukebox in nlm_fopen should lead to a retry
  lockd: while grace prefer to fail with nlm_lck_denied_grace_period

 fs/lockd/svc4proc.c | 15 +++++++++++++--
 fs/nfsd/lockd.c     |  1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

-- 
2.47.1


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

end of thread, other threads:[~2025-08-11 19:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11 18:18 [RFC PATCH 0/2] nfsd/lockd: v3/v4 lock conflict in presence of delegations Olga Kornievskaia
2025-08-11 18:18 ` [RFC PATCH 1/2] nfsd: nfserr_jukebox in nlm_fopen should lead to a retry Olga Kornievskaia
2025-08-11 19:10   ` Jeff Layton
2025-08-11 19:23     ` Jeff Layton
2025-08-11 19:32     ` Olga Kornievskaia
2025-08-11 19:56       ` Jeff Layton
2025-08-11 19:57         ` Chuck Lever
2025-08-11 18:18 ` [RFC PATCH 2/2] lockd: while grace prefer to fail with nlm_lck_denied_grace_period Olga Kornievskaia
2025-08-11 19:14   ` Jeff Layton
2025-08-11 19:59     ` 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).