All of lore.kernel.org
 help / color / mirror / Atom feed
* NFSDv3 alone can't export btrfs dirs: mount.nfs: mount(2): Stale file handle
@ 2026-12-03 16:42 Marius Dinu via Bugspray Bot
  2026-12-03 16:42 ` The Linux kernel's regression tracker (Thorsten Leemhuis) via Bugspray Bot
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Marius Dinu via Bugspray Bot @ 2026-12-03 16:42 UTC (permalink / raw)
  To: linux-nfs, anna, cel, jlayton, trondmy

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.

Thank you.
Marius

View: https://bugzilla.kernel.org/show_bug.cgi?id=221788#c0
You can reply to this message to join the discussion.
-- 
Deet-doot-dot, I am a bot.
Kernel.org Bugzilla (bugspray 0.1-dev)


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-12-03 18:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2026-12-03 17:35 ` Jeff Layton via Bugspray Bot
2026-12-03 18:55 ` Marius Dinu via Bugspray Bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.