Backport for "NLM/NFSD: Fix lock notifications for async-capable"
Status from this message: Queued the series for 6.12, thanks.
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | fs: Introduce FOP_ASYNC_LOCKinclude/ include/ | +7 | 0 replies | |
| 2/4 | gfs2/ocfs2: set FOP_ASYNC_LOCKfs/ fs/ | +4 | 0 replies | |
| 3/4 | NLM/NFSD: Fix lock notifications for async-capable filesystemsfs/ fs/ | +7 | 0 replies | |
| 4/4 | nfsd: fix FL_SLEEP being set unconditionally for all LOCK typesfs/ | +5 | 0 replies |
Reviews trailers per patch
3 of 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Jeff Layton |
|---|---|
| Series | R-b |
| 1/4 | R-b |
| 2/4 | R-b |
| 3/4 | R-b |
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 6.12.y 0/4] Backport for "NLM/NFSD: Fix lock notifications for async-capable"
Hi
In Debian bug https://bugs.debian.org/1153524 reported a regression after updating from 6.1.y to the 6.12.y series, explained as follows:
Quoted 43 lines
After upgrading an NFS server from the bookworm 6.1 kernel to the trixie 6.12 kernel, blocking locks taken on an NFSv4.2 export by two different clients are no longer woken up when the holder releases them. The waiting client stalls for about 30 seconds (the client-side
NFS4_LOCK_MAXTIMEOUTback-off) instead of getting the lock as soon as it is released. Setup* Server: Debian 13.7, linux-image-6.12.116+deb13-amd64 6.12.116-
1, nfs-kernel-server 1:2.8.3-1. The export is on ext4 (md RAID), options sync,wdelay,hide,no_subtree_check,sec=sys,rw,secure,roo- t_squash,no_all_squash.* Clients: two Debian 13 hosts running 6.12.116+deb13-amd64,
mounted with vers=4.2.
* The clients have run 6.12 since August 2026, and cross-client
locking worked while the server ran 6.1.0-54-amd64. The stalls started on 2026-11-05, when the server moved to 6.12.115-1. Nothing changed on the clients that day, so the regression is on the server side.Reproducer
client A: flock -x /mnt/share/testfile sleep 5 client B (1.5 s later): time flock -x -w 60 /mnt/share/testfile trueExpected: B gets the lock after about 3.5 s. Observed on 2026-11-09 with 6.12.116-1: 31.61 s. With both processes on client A, the wait is 3.51 s. Server-side traces (6.12.115-1, 2026-11-06, kernel tracepoints during the same test)
* The blocking LOCK from client B (
WRITEW_LT) reaches nfsd, but
nfsd sets the lock withoutFL_SLEEP:posix_lock_inodeshows fl_flags=FL_POSIX only. The server therefore treats it as non-
blocking: it returnsNFS4ERR_DENIEDand records no blocked lock.
* When client A releases the lock (OP_LOCKU), nonfsd_cb_queueor
nfsd_cb_notify_lockevent appears.CB_NOTIFY_LOCKis never sent.
* The client behaves as designed. It waits for the notification up
to the 30 s cap, then retries: two LOCK attempts in total, at t0 and at t0+31 s.
* I found a recent nfsd series that fixes theFL_SLEEPtest in
nfsd4_lock(introduced by7e64c5bc497c), but for the opposite
case:FL_SLEEPwrongly set on non-blocking locks. This report may be the mirror case, but I have not confirmed the root cause.
Quoted 6 lines
Impact
Any application that serialises on files shared across NFS clients stalls for 30 s per contended lock. In our case, PHP file sessions on a two-node web front caused gateway timeouts. We have worked around it (sessions moved to a database, load-balancer session affinity), but the bug still affects other shared directories.
It was forwarded to th NFS list:
Jeff Layton determined:
Quoted 8 lines
Ben Coddington's series fixed the check in v6.13. None of it went to 6.12.y:
8cf9a01edc21("fs: IntroduceFOP_ASYNC_LOCK")2253ab99f2e9("gfs2/ocfs2: setFOP_ASYNC_LOCK")7e64c5bc497c("NLM/NFSD: Fix lock notifications for async-capable
filesystems")
Quoted 4 lines
The recent patch you noticed is
246a90a5109b("nfsd: fixFL_SLEEPbeing set unconditionally for all LOCK types"). It fixes a bug that7e64c5bc497cintroduced, so it needs to be backported along with the other three.
The 4 patches following are matching the above.
*Though* I defintively prefer if those will come directly from Jeff or will get an ack from him here.
In Debian we will be in need to apply those ideally with the next round of updates we are going to push.
Regards,
Salvatore