From: Jeff Layton <jlayton@kernel.org>
To: Julien Leclerc <julien.leclerc@saatchi.fr>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Cc: Chuck Lever <chuck.lever@oracle.com>,
"regressions@lists.linux.dev" <regressions@lists.linux.dev>,
"1153524@bugs.debian.org" <1153524@bugs.debian.org>
Subject: Re: [REGRESSION] nfsd: blocking NFSv4.2 LOCK never woken by CB_NOTIFY_LOCK since 6.12, cross-client waiters stall 30 s
Date: Tue, 01 Dec 2026 09:06:00 -0500 [thread overview]
Message-ID: <28b95155ac40f5435eb94f206ff1e35111ce481a.camel@kernel.org> (raw)
In-Reply-To: <SADPR02MB57477008DD7FC05578586D9C93E84D2@SADPR02MB574770.namprd02.prod.outlook.com>
On Tue, 2026-12-01 at 09:56 +0000, Julien Leclerc wrote:
> Hello,
>
> Since our NFS server moved from the 6.1 kernel to 6.12, blocking locks
> taken by two different NFSv4.2 clients are no longer woken up when the
> holder releases them. The waiting client only gets the lock after its
> 30 s back-off (NFS4_LOCK_MAXTIMEOUT). I reported this to Debian three
> weeks ago (https://bugs.debian.org/1153524, in Cc). It still reproduces
> with the latest 6.12 stable update, so I am bringing it here.
>
> Versions (server side, Debian kernels)
>
> Last known good: 6.1.0-54-amd64 (bookworm)
> First known bad: 6.12.115-1 (trixie)
> Still bad: 6.12.116-1, 6.12.118-1
> Mainline: not tested
>
> The clients ran 6.12 for three months before the server upgrade, and
> cross-client locking worked during that time. Nothing changed on the
> clients when the stalls started, so the regression is on the server.
>
> Setup
>
> - Server: Debian 13, nfs-kernel-server 1:2.8.3-1, export on ext4 over
> md RAID1, options sync,wdelay,hide,no_subtree_check,sec=sys,rw,
> secure,root_squash,no_all_squash.
> - Clients: two Debian 13 hosts, same kernel as the server, mounted with
> vers=4.2 (local_lock=none).
>
> Reproducer
>
> client A: flock -x /mnt/share/testfile sleep 2
> client B, 1 s later: time flock -x -w 60 /mnt/share/testfile true
>
> Results on 6.12.118 (server and clients), 2026-12-01:
>
> A holds, B waits: 30.55 s, then 30.65 s
> B holds, A waits: 31.93 s
> A holds, A waits: 0.54 s (same client, control)
>
> Server-side traces (6.12.115, same test, kernel tracepoints)
>
> - The blocking LOCK from client B (WRITEW_LT) reaches nfsd, but the
> lock is set without FL_SLEEP: posix_lock_inode shows
> fl_flags=FL_POSIX only. nfsd treats it as non-blocking, returns
> NFS4ERR_DENIED and records no blocked lock.
> - When client A releases the lock (OP_LOCKU), there is no
> nfsd_cb_queue or nfsd_cb_notify_lock event: CB_NOTIFY_LOCK is never
> sent.
> - The client behaves as designed: it waits for the callback up to the
> 30 s cap, then retries. Two LOCK attempts in total, at t0 and t0+31 s.
>
> I noticed a recent nfsd series that fixes the FL_SLEEP test in
> nfsd4_lock (introduced by 7e64c5bc497c), but for the opposite case,
> FL_SLEEP wrongly set on non-blocking locks. This may be the mirror
> case; I have not confirmed the root cause.
>
> Impact: any application that serialises on files shared between NFS
> clients stalls for 30 s per contended lock. For us it was PHP file
> sessions on a two-node web front, which caused gateway timeouts. We
> have a workaround in place, but other shared directories are still
> exposed.
>
> The affected server is in production, so I cannot easily boot a
> mainline kernel on it. I can test patches on the Debian 6.12 kernel,
> collect more traces, or try to reproduce on a separate test setup if
> that would help.
>
> #regzbot introduced: v6.1..v6.12
>
> Best regards,
>
> Julien Leclerc
>
> Directeur technique
> Saatchi&Saatchi
>
> 145 rue de Courcelles
> 75017 Paris
> (+33) 6 62 83 71 93
>
> julien.leclerc@saatchi.fr
>
> www.saatchi.fr
>
>
Thanks for the detailed report. The traces pointed straight at the
problem.
In v6.12.y, nfsd4_lock() sets FL_SLEEP on a blocking LOCK from an
NFSv4.1+ client, then clears it again unless the exported filesystem
sets EXPORT_OP_ASYNC_LOCK:
if (!exportfs_lock_op_is_async(sb->s_export_op))
flags &= ~FL_SLEEP;
Only gfs2 and ocfs2 set EXPORT_OP_ASYNC_LOCK. On ext4, every blocking
LOCK reaches vfs_lock_file() as a plain FL_POSIX request. NFSD does
not queue an nfsd4_blocked_lock for it, and posix_lock_inode() does
not add a waiter to the conflicting lock. The LOCKU from the other
client then has no waiter to wake, so NFSD never sends CB_NOTIFY_LOCK.
v6.1 tested f_op->lock instead. ext4 has no ->lock method, so FL_SLEEP
stayed set. The check changed in v6.7 with:
2dd10de8e6bc ("lockd: introduce safe async lock op")
Ben Coddington's series fixed the check in v6.13. None of it went to
6.12.y:
8cf9a01edc21 ("fs: Introduce FOP_ASYNC_LOCK")
2253ab99f2e9 ("gfs2/ocfs2: set FOP_ASYNC_LOCK")
7e64c5bc497c ("NLM/NFSD: Fix lock notifications for async-capable
filesystems")
The recent patch you noticed is 246a90a5109b ("nfsd: fix FL_SLEEP
being set unconditionally for all LOCK types"). It fixes a bug that
7e64c5bc497c introduced, so it needs to be backported along with the
other three.
All four commits apply to v6.12.118 with one trivial conflict in
include/linux/fs.h. v6.12 already defines FOP_UNSIGNED_OFFSET as bit
5, so FOP_ASYNC_LOCK goes in as (1 << 6), its value in v6.13. I've
only compile-tested the result. Could you try it on your test setup?
A Tested-by from you would help the case for taking the series into
6.12.y.
#regzbot introduced: 2dd10de8e6bc
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2026-12-01 14:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 9:56 [REGRESSION] nfsd: blocking NFSv4.2 LOCK never woken by CB_NOTIFY_LOCK since 6.12, cross-client waiters stall 30 s Julien Leclerc
2026-12-01 14:06 ` Jeff Layton [this message]
2026-12-01 17:08 ` Julien Leclerc
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=28b95155ac40f5435eb94f206ff1e35111ce481a.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=1153524@bugs.debian.org \
--cc=chuck.lever@oracle.com \
--cc=julien.leclerc@saatchi.fr \
--cc=linux-nfs@vger.kernel.org \
--cc=regressions@lists.linux.dev \
/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