Linux NFS development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Salvatore Bonaccorso <carnil@debian.org>,
	Julien Leclerc <julien.leclerc@saatchi.fr>
Cc: linux-nfs@vger.kernel.org, 1153524@bugs.debian.org,
	Chuck Lever	 <chuck.lever@oracle.com>,
	regressions@lists.linux.dev, stable@vger.kernel.org
Subject: Re: [PATCH 6.12.y 0/4] Backport for "NLM/NFSD: Fix lock notifications for async-capable"
Date: Fri, 04 Dec 2026 09:37:00 -0500	[thread overview]
Message-ID: <8aaf64f519e700d47a44da56e054ebe7beeaf094.camel@kernel.org> (raw)
In-Reply-To: <20261204142703.1100372-1-carnil@debian.org>

On Fri, 2026-12-04 at 15:20 +0100, Salvatore Bonaccorso wrote:
> 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:
> 
> > 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_MAXTIMEOUT back-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 true
> > 
> > Expected: 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 without FL_SLEEP: posix_lock_inode shows
> >       fl_flags=FL_POSIX only. The server therefore treats it as non-
> >       blocking: it returns NFS4ERR_DENIED and records no blocked lock.
> >   *   When client A releases the lock (OP_LOCKU), no nfsd_cb_queue or
> >       nfsd_cb_notify_lock event appears. CB_NOTIFY_LOCK is 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 the FL_SLEEP test in
> >       nfsd4_lock (introduced by 7e64c5bc497c), but for the opposite
> >       case: FL_SLEEP wrongly set on non-blocking locks. This report
> >       may be the mirror case, but I have not confirmed the root cause.
> > 
> > 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:
> 
> https://lore.kernel.org/linux-nfs/SADPR02MB574770B2C27CA5277D9878958CE84D2@SADPR02MB574770.namprd02.prod.outlook.com/T/#mf090eb57d7770d471224ec0cb6a564ae2010d75f
> 
> Jeff Layton determined:
> 
> > 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.
> 
> 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

This all looks fine to me. Thanks for doing this, Salvatore.

Reviewed-by: Jeff Layton <jlayton@kernel.org>

  parent reply	other threads:[~2026-12-04 14:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 14:20 [PATCH 6.12.y 0/4] Backport for "NLM/NFSD: Fix lock notifications for async-capable" Salvatore Bonaccorso
2026-12-04 14:20 ` [PATCH 1/4] fs: Introduce FOP_ASYNC_LOCK Salvatore Bonaccorso
2026-12-04 14:20 ` [PATCH 2/4] gfs2/ocfs2: set FOP_ASYNC_LOCK Salvatore Bonaccorso
2026-12-04 14:20 ` [PATCH 3/4] NLM/NFSD: Fix lock notifications for async-capable filesystems Salvatore Bonaccorso
2026-12-04 14:20 ` [PATCH 4/4] nfsd: fix FL_SLEEP being set unconditionally for all LOCK types Salvatore Bonaccorso
2026-12-04 14:37 ` Jeff Layton [this message]
2026-12-04 19:49 ` [PATCH 6.12.y 0/4] Backport for "NLM/NFSD: Fix lock notifications for async-capable" Sasha Levin

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=8aaf64f519e700d47a44da56e054ebe7beeaf094.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=1153524@bugs.debian.org \
    --cc=carnil@debian.org \
    --cc=chuck.lever@oracle.com \
    --cc=julien.leclerc@saatchi.fr \
    --cc=linux-nfs@vger.kernel.org \
    --cc=regressions@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    /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