From: Jeff Layton <jlayton@kernel.org>
To: Marius Dinu via Bugspray Bot <bugbot@kernel.org>,
linux-nfs@vger.kernel.org, anna@kernel.org, cel@kernel.org,
trondmy@kernel.org
Subject: Re: NFSDv3 alone can't export btrfs dirs: mount.nfs: mount(2): Stale file handle
Date: Thu, 03 Dec 2026 12:24:37 -0500 [thread overview]
Message-ID: <e942e9d5bc2792d740b7c86c625ed02c38b9f87f.camel@kernel.org> (raw)
In-Reply-To: <20261203-b221788c0-8b47dbb925d2@bugzilla.kernel.org>
On Thu, 2026-12-03 at 16:42 +0000, Marius Dinu via Bugspray Bot wrote:
> Marius Dinu writes via Kernel.org Bugzilla:
>
> Hi.
>
> Kernel v7.2-rc4, git master branch, self-built.
>
> When built without CONFIG_NFSD_V4, all clients fail to mount directories shared from btrfs.
>
> To reproduce the bug:
>
> 1) Build a kernel with this config and boot it:
>
> # zgrep -E 'CONFIG_BTRFS|CONFIG_EXPORTFS|CONFIG_NFS' /proc/config.gz
> CONFIG_BTRFS_FS=y
> # CONFIG_BTRFS_FS_POSIX_ACL is not set
> # CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
> # CONFIG_BTRFS_DEBUG is not set
> # CONFIG_BTRFS_ASSERT is not set
> # CONFIG_BTRFS_EXPERIMENTAL is not set
> CONFIG_EXPORTFS=y
> CONFIG_EXPORTFS_BLOCK_OPS=y
> CONFIG_NFS_FS=y
> # CONFIG_NFS_V2 is not set
> CONFIG_NFS_V3=y
> # CONFIG_NFS_V3_ACL is not set
> # CONFIG_NFS_V4 is not set
> # CONFIG_NFS_SWAP is not set
> # CONFIG_NFS_FSCACHE is not set
> CONFIG_NFS_DEBUG=y
> # CONFIG_NFS_DISABLE_UDP_SUPPORT is not set
> CONFIG_NFSD=y
> # CONFIG_NFSD_V2 is not set
> # CONFIG_NFSD_V3_ACL is not set
> # CONFIG_NFSD_V4 is not set
> CONFIG_NFS_COMMON=y
> # CONFIG_NFS_LOCALIO is not set
>
> 2) Start userspace daemons: rpcbind, rpc.nfsd, rpc.mountd, rpc.statd
>
> 3) Export a btrfs directory (in this example, /build):
>
> # cat /etc/exports
> /build -rw 172.27.143.9
>
> # exportfs -rav
> exporting 172.27.143.9:/build
>
> 4) Try to mount it from a client (in this example, same machine):
>
> # mount -v -t nfs -o vers=3,softerr,timeo=10,retrans=0,fg 172.27.143.9:/build /mnt/test
> mount.nfs: timeout set for Sat Jul 25 10:14:23 2026
> mount.nfs: trying text-based options 'vers=3,softerr,timeo=3,retrans=0,fg,addr=172.27.143.9'
> mount.nfs: prog 100003, trying vers=3, prot=6
> mount.nfs: trying 172.27.143.9 prog 100003 vers 3 prot TCP port 2049
> mount.nfs: prog 100005, trying vers=3, prot=17
> mount.nfs: trying 172.27.143.9 prog 100005 vers 3 prot UDP port 56200
> rpc.mountd: Received NULL request from 172.27.143.9
> rpc.mountd: Received NULL request from 172.27.143.9
> rpc.mountd: Received MNT3(/build) request from 172.27.143.9
> rpc.mountd: v4root_create: path '/' flags 0x12403
> rpc.mountd: v4root_create: path '/' flags 0x12403
> rpc.mountd: authenticated mount request from 172.27.143.9:1012 for /build (/build)
> rpc.mountd: granted access to /build for 172.27.143.9
> rpc.mountd: nfsd_fh: inbuf '172.27.143.9 0 \x0000001d00010000'
> rpc.mountd: denied access to 172.27.143.9
> rpc.mountd: nfsd_fh: found (nil) path (null)
> mount.nfs: mount(2): Stale file handle
> mount.nfs: Stale file handle for 172.27.143.9:/build on /mnt/test
>
> Note the error: "denied access to 172.27.143.9" and "nfsd_fh: found (nil) path (null)". That's AFTER the mount request was granted.
>
> My investigation so far:
> - selecting CONFIG_NFSD_V4 and nothing else makes the exact same NFSv3 mount work
> - exports from ext2 work even without CONFIG_NFSD_V4, exact same config
> - adding "fsid=0" to options in /etc/exports makes it work without CONFIG_NFSD_V4 even from btrfs
>
> I suspect that NFSDv3, when v4 is not selected, uses file handles that are too short to fit files/dirs coming from btrfs. The auto-generated fsid might be too long.
>
I thought that too, but it looks like it's not, actually. It looks like
the problem is that fsloc_parse() and secinfo_parse() are stubbed out
when NFSv4 isn't built and that breaks the export downcall parser. I'll
send a patch soon.
Thanks for the bug report!
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2026-12-03 17:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 16:42 NFSDv3 alone can't export btrfs dirs: mount.nfs: mount(2): Stale file handle Marius Dinu via Bugspray Bot
2026-12-03 16:42 ` The Linux kernel's regression tracker (Thorsten Leemhuis) via Bugspray Bot
2026-12-03 16:42 ` Marius Dinu via Bugspray Bot
2026-12-03 16:43 ` The Linux kernel's regression tracker (Thorsten Leemhuis) via Bugspray Bot
2026-12-03 17:24 ` Jeff Layton [this message]
2026-12-03 17:35 ` Jeff Layton via Bugspray Bot
2026-12-03 18:55 ` Marius Dinu via Bugspray Bot
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=e942e9d5bc2792d740b7c86c625ed02c38b9f87f.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=anna@kernel.org \
--cc=bugbot@kernel.org \
--cc=cel@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=trondmy@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