* [REGRESSION] nfsd: blocking NFSv4.2 LOCK never woken by CB_NOTIFY_LOCK since 6.12, cross-client waiters stall 30 s @ 2026-12-01 9:56 Julien Leclerc 2026-12-01 14:06 ` Jeff Layton 0 siblings, 1 reply; 3+ messages in thread From: Julien Leclerc @ 2026-12-01 9:56 UTC (permalink / raw) To: linux-nfs@vger.kernel.org Cc: Chuck Lever, Jeff Layton, regressions@lists.linux.dev, 1153524@bugs.debian.org 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 ------------------------------------------------------------------------ Disclaimer The information in this email and any attachments may contain proprietary and confidential information that is intended for the addressee(s) only. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, retention or use of the contents of this information is prohibited. When addressed to our clients or vendors, any information contained in this e-mail or any attachments is subject to the terms and conditions in any governing contract. If you have received this e-mail in error, please immediately contact the sender and delete the e-mail. ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [REGRESSION] nfsd: blocking NFSv4.2 LOCK never woken by CB_NOTIFY_LOCK since 6.12, cross-client waiters stall 30 s 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 2026-12-01 17:08 ` Julien Leclerc 0 siblings, 1 reply; 3+ messages in thread From: Jeff Layton @ 2026-12-01 14:06 UTC (permalink / raw) To: Julien Leclerc, linux-nfs@vger.kernel.org Cc: Chuck Lever, regressions@lists.linux.dev, 1153524@bugs.debian.org 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> ^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [REGRESSION] nfsd: blocking NFSv4.2 LOCK never woken by CB_NOTIFY_LOCK since 6.12, cross-client waiters stall 30 s 2026-12-01 14:06 ` Jeff Layton @ 2026-12-01 17:08 ` Julien Leclerc 0 siblings, 0 replies; 3+ messages in thread From: Julien Leclerc @ 2026-12-01 17:08 UTC (permalink / raw) To: Jeff Layton, linux-nfs@vger.kernel.org Cc: Chuck Lever, regressions@lists.linux.dev, 1153524@bugs.debian.org Hi Jeff, Thanks for digging into this so quickly. Your explanation matches everything we saw in the traces. I tested the four commits on top of v6.12.118, resolving the fs.h conflict the same way (FOP_ASYNC_LOCK as (1 << 6)), on a separate test setup: - Server: Debian 13, x86_64, v6.12.118 + the 4 commits, built with the config of the Debian 6.12.118 kernel; export on ext4 with the same options as our production server. - Clients: two Debian 13 hosts (Debian 6.12.118), mounted with vers=4.2. - Test: client A holds an exclusive flock for 4 s, client B asks for it 1 s later with flock -w 60. Debian 6.12.118 on the server (unpatched): A holds, B waits: 31.32 s, 31.37 s B holds, A waits: 30.64 s A holds, A waits: 3.59 s (same client, control) v6.12.118 + the 4 commits on the server: A holds, B waits: 3.16 s, 3.04 s, 2.98 s, 3.17 s B holds, A waits: 2.99 s, 2.96 s A holds, A waits: 2.98 s, 2.98 s (same client, control) The waiter now gets the lock as soon as it is released (the remaining ~3 s is the holder's sleep). With the nfsd tracepoints enabled, the LOCKU is followed by nfsd_cb_notify_lock and nfsd_cb_queue for the waiting client, then nfsd_cb_notify_lock_done. A non-blocking request (flock -n) still fails immediately. Tested-by: Julien Leclerc <julien.leclerc@saatchi.fr> Thanks again for the quick backport. Julien Leclerc Directeur technique Saatchi&Saatchi ________________________________________ De : Jeff Layton <jlayton@kernel.org> Envoyé : mardi 1 décembre 2026 15:06 À : Julien Leclerc; linux-nfs@vger.kernel.org Cc : Chuck Lever; regressions@lists.linux.dev; 1153524@bugs.debian.org Objet : Re: [REGRESSION] nfsd: blocking NFSv4.2 LOCK never woken by CB_NOTIFY_LOCK since 6.12, cross-client waiters stall 30 s External to the Groupe / en provenance de l'extérieur du Groupe 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> ------------------------------------------------------------------------ Disclaimer The information in this email and any attachments may contain proprietary and confidential information that is intended for the addressee(s) only. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, retention or use of the contents of this information is prohibited. When addressed to our clients or vendors, any information contained in this e-mail or any attachments is subject to the terms and conditions in any governing contract. If you have received this e-mail in error, please immediately contact the sender and delete the e-mail. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-12-01 17:08 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 2026-12-01 17:08 ` Julien Leclerc
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox