Path: csiph.com!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Thorsten Leemhuis Newsgroups: linux.debian.bugs.dist,linux.debian.kernel Subject: Bug#1128861: Regression: Missing check in nfsd_permission() causes -ENOLCK No locks available Date: Fri, 27 Feb 2026 11:10:01 +0100 Message-ID: References: X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Fri Feb 27 10:05:08 2026 Old-Return-Path: X-Spam-Flag: NO X-Spam-Score: -1.45 Reply-To: Thorsten Leemhuis , 1128861@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: debian-kernel@lists.debian.org X-Debian-Pr-Message: followup 1128861 X-Debian-Pr-Package: src:linux X-Debian-Pr-Source: linux Authentication-Results: mxe9fb; spf=pass (sender IP is 2a02:8108:8984:1d00:a0cf:1912:4be:477f) smtp.mailfrom=regressions@leemhuis.info smtp.helo=[IPV6:2a02:8108:8984:1d00:a0cf:1912:4be:477f] Received-Spf: pass (mxe9fb: connection is authenticated) MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: de-DE, en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ppp-Message-ID: <177218605665.3127215.6362207666060754103@mxe9fb.netcup.net> X-Rspamd-Server: rspamd-worker-8404 X-Rspamd-Queue-ID: 5039461786 X-Nc-Cid: 2qkeduFVg/8fbJJvJbazbisUR09+48lXIaxci0UUPW39xtckrcQ= X-Greylist: delayed 528 seconds by postgrey-1.37 at buxtehude; Fri, 27 Feb 2026 10:03:11 UTC X-Debian-Message: from BTS X-Mailing-List: archive/latest/1955367 List-ID: List-URL: Approved: robomod@news.nic.it Lines: 62 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Cc: linux-nfs@vger.kernel.org, Olga Kornievskaia , stable@vger.kernel.org, Chuck Lever , Jeff Layton , Linux NFS Mailing List X-Original-Date: Fri, 27 Feb 2026 10:54:13 +0100 X-Original-Message-ID: <418f30b5-06ae-471f-bf5f-f14f3f75deff@leemhuis.info> X-Original-References: <177187492815.425331.14320091315652332093.reportbug@nimble> Xref: csiph.com linux.debian.bugs.dist:1283789 linux.debian.kernel:91452 [CCing a few people and lists] On 2/24/26 03:09, Tj wrote: > Upstream commit 4cc9b9f2bf4dfe13fe573 "nfsd: refine and rename > NFSD_MAY_LOCK" and >  stable v6.12.54 commit 18744bc56b0ec In case anyone just like me is wondering: the latter is a backport of the former. >  (re)moves checks from fs/nfsd/vfs.c::nfsd_permission().>  This causes NFS clients to see > > $ flock -e -w 4 /srv/NAS/test/debian-13.3.0-amd64-netinst.iso sleep 1 > flock: /srv/NAS/test/debian-13.3.0-amd64-netinst.iso: No locks available Does this happen on mainline (e.g. 7.0-rc1) as well? Ciao, Thorsten > Keeping the check in nfsd_permission() whilst also copying it to > fs/nfsd/nfsfh.c::__fh_verify() resolves the issue. > > This was discovered on the Debian openQA infrastructure server when > upgrading kernel from v6.12.48 to later v6.12.y where worker hosts (with > any earlier or later kernel version) pass NFSv3 mounted ISO images to > qemu-system-x86_64 and it reports: > > !!! : qemu-system-x86_64: -device > scsi-cd,id=cd0-device,drive=cd0-overlay0,serial=cd0: Failed to get > "consistent read" lock: No locks available > QEMU: Is another process using the image > [/var/lib/openqa/pool/2/20260223-1-debian-testing-amd64-netinst.iso]? > > A simple reproducer with the server using: > > # cat /etc/exports.d/test.exports > /srv/NAS/test > fdff::/64(fsid=0,rw,no_root_squash,sync,no_subtree_check,auth_nlm) > > and clients using: > > # mount -t nfs [fdff::2]:/srv/NAS/test /srv/NAS/test -o > proto=tcp6,ro,fsc,soft > > will trigger the error as shown above: > > $ flock -e -w 4 /srv/NAS/test/debian-13.3.0-amd64-netinst.iso sleep 1 > flock: /srv/NAS/test/debian-13.3.0-amd64-netinst.iso: No locks available > > A simple test program calling fcntl() with the same arguments QEMU uses > also fails in the same way. > > $ ./nfs3_range_lock_test > /srv/NAS/test/debian-13.3.0-amd64-netinst.{iso,overlay} > Opened base file: /srv/NAS/test/debian-13.3.0-amd64-netinst.iso > Opened overlay file: /srv/NAS/test/debian-13.3.0-amd64-netinst.overlay > Attempting lock at 4 on /srv/NAS/test/debian-13.3.0-amd64-netinst.iso > fcntl(fd, F_GETLK, &fl) failed on base: No locks available > Attempting lock at 8 on /srv/NAS/test/debian-13.3.0-amd64-netinst.overlay > fcntl(fd, F_GETLK, &fl) failed on overlay: No locks available > >