* NFSv4 client: statx() returns EINVAL after readdir on same directory (kernel 7.0.0)
@ 2026-12-03 16:42 kernel.zie66 via Bugspray Bot
2026-12-03 16:42 ` The Linux kernel's regression tracker (Thorsten Leemhuis) via Bugspray Bot
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: kernel.zie66 via Bugspray Bot @ 2026-12-03 16:42 UTC (permalink / raw)
To: linux-nfs, anna, cel, jlayton, trondmy
kernel.zie66 writes via Kernel.org Bugzilla:
On kernel 7.0.0-7-generic (Ubuntu 26.04), statx() on an NFSv4-mounted
directory returns -EINVAL after readdir has been called on that directory.
The fstatat() syscall on the same path succeeds. The error is transient since a subsequent statx() call succeeds. NFSv3 is unaffected.
This breaks Go programs (which use statx since Go 1.22), Rust coreutils
(default on Ubuntu 26.04), and containerd/Kubernetes pod startup.
Reproduction:
mount -t nfs4 server:/export /mnt/nfs
python3 -c "
import ctypes, os
libc = ctypes.CDLL('libc.so.6', use_errno=True)
class Statx(ctypes.Structure):
_fields_ = [('stx_mask',ctypes.c_uint32),('stx_blksize',ctypes.c_uint32),
('stx_attributes',ctypes.c_uint64),('stx_nlink',ctypes.c_uint32),
('stx_uid',ctypes.c_uint32),('stx_gid',ctypes.c_uint32),
('stx_mode',ctypes.c_uint16),('stx_pad1',ctypes.c_uint16),
('stx_ino',ctypes.c_uint64),('stx_size',ctypes.c_uint64),
('stx_blocks',ctypes.c_uint64),('stx_attributes_mask',ctypes.c_uint64),
('rest',ctypes.c_byte*256)]
path = b'/mnt/nfs/'
def do_statx(label):
buf = Statx()
ret = libc.statx(-100, path, 0x100, 0x0fff, ctypes.byref(buf))
err = ctypes.get_errno()
print(f'{label}: ret={ret} errno={err}')
do_statx('before readdir')
os.listdir('/mnt/nfs/')
do_statx('after readdir') # <-- returns -EINVAL
os.stat('/mnt/nfs/') # fstatat works fine
do_statx('after fstatat') # healed, works again
"
Server-side traces (nfsd tracepoints) show all operations returning
status=0, and the error is generated entirely client-side.
Backend filesystem is bcachefs (DKMS module), but this appears to be
an NFS client issue since the server reports success.
View: https://bugzilla.kernel.org/show_bug.cgi?id=221261#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] 5+ messages in thread
* Re: NFSv4 client: statx() returns EINVAL after readdir on same directory (kernel 7.0.0)
2026-12-03 16:42 NFSv4 client: statx() returns EINVAL after readdir on same directory (kernel 7.0.0) kernel.zie66 via Bugspray Bot
@ 2026-12-03 16:42 ` The Linux kernel's regression tracker (Thorsten Leemhuis) via Bugspray Bot
2026-12-03 16:42 ` kernelbugs via Bugspray Bot
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: The Linux kernel's regression tracker (Thorsten Leemhuis) via Bugspray Bot @ 2026-12-03 16:42 UTC (permalink / raw)
To: linux-nfs, anna, cel, jlayton, trondmy
The Linux kernel's regression tracker (Thorsten Leemhuis) writes via Kernel.org Bugzilla:
> 7.0.0-7-generic
That sounds like a highly patched vendor kernel, which leads to the question: Does this happen with a upstream kernel, too? And it sounds like this worked in earlier version, hence: could you bisect?
View: https://bugzilla.kernel.org/show_bug.cgi?id=221261#c1
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] 5+ messages in thread
* Re: NFSv4 client: statx() returns EINVAL after readdir on same directory (kernel 7.0.0)
2026-12-03 16:42 NFSv4 client: statx() returns EINVAL after readdir on same directory (kernel 7.0.0) kernel.zie66 via Bugspray Bot
2026-12-03 16:42 ` The Linux kernel's regression tracker (Thorsten Leemhuis) via Bugspray Bot
@ 2026-12-03 16:42 ` kernelbugs via Bugspray Bot
2026-12-03 16:42 ` kernel.zie66 via Bugspray Bot
2026-12-03 16:42 ` kernelbugs via Bugspray Bot
3 siblings, 0 replies; 5+ messages in thread
From: kernelbugs via Bugspray Bot @ 2026-12-03 16:42 UTC (permalink / raw)
To: linux-nfs, anna, cel, jlayton, trondmy
kernelbugs writes via Kernel.org Bugzilla:
I am also encountering this since 6.19 (6.18 was good for the versions I tested). I admittedly am running ZFS under the NFS4 share, but otherwise a completely stock kernel. I filed a similar bug with ZFS, but this seems quite similar, but with a different underlying file system. My issue on the ZFS side is filed here: https://github.com/openzfs/zfs/issues/18487
Bisect is quite difficult in my setup, but hopefully that 6.18.13 is good and kernel 6.19.11 is definitely bad might help if there were interesting changes between those. Repro is pretty consistent by running bazel from the client, and often manifests with containers as noted by the original filer.
View: https://bugzilla.kernel.org/show_bug.cgi?id=221261#c2
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] 5+ messages in thread
* Re: NFSv4 client: statx() returns EINVAL after readdir on same directory (kernel 7.0.0)
2026-12-03 16:42 NFSv4 client: statx() returns EINVAL after readdir on same directory (kernel 7.0.0) kernel.zie66 via Bugspray Bot
2026-12-03 16:42 ` The Linux kernel's regression tracker (Thorsten Leemhuis) via Bugspray Bot
2026-12-03 16:42 ` kernelbugs via Bugspray Bot
@ 2026-12-03 16:42 ` kernel.zie66 via Bugspray Bot
2026-12-03 16:42 ` kernelbugs via Bugspray Bot
3 siblings, 0 replies; 5+ messages in thread
From: kernel.zie66 via Bugspray Bot @ 2026-12-03 16:42 UTC (permalink / raw)
To: linux-nfs, anna, cel, jlayton, trondmy
kernel.zie66 writes via Kernel.org Bugzilla:
Okay, since this is a problem for more than just me, I can take a look and report back. I'm a n00b, so it disect might take a bit, but in either cases, I'll at least give it a try and report back. Thanks.
View: https://bugzilla.kernel.org/show_bug.cgi?id=221261#c3
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] 5+ messages in thread
* Re: NFSv4 client: statx() returns EINVAL after readdir on same directory (kernel 7.0.0)
2026-12-03 16:42 NFSv4 client: statx() returns EINVAL after readdir on same directory (kernel 7.0.0) kernel.zie66 via Bugspray Bot
` (2 preceding siblings ...)
2026-12-03 16:42 ` kernel.zie66 via Bugspray Bot
@ 2026-12-03 16:42 ` kernelbugs via Bugspray Bot
3 siblings, 0 replies; 5+ messages in thread
From: kernelbugs via Bugspray Bot @ 2026-12-03 16:42 UTC (permalink / raw)
To: linux-nfs, anna, cel, jlayton, trondmy
kernelbugs writes via Kernel.org Bugzilla:
I put more details in the ZFS bug. tl;dr is that for me it's not just statx (so I'm not 100% sure this is exactly the same), but does seem to be "near" readdir, such as readdir followed by getdents. `git status` or 'rsync -av /nfs/lotsoffiles/ /nfs/lotsoffiles2/` are particularly good at triggering it. NFS logs and tcpdump don't seem any different to me. I cannot reproduce this on 6.18 series at all, but 6.19.something (I started at 11, haven't bisected further) seems to have kicked this off.
If you can help bisect, thanks! I guess we can find out that way if my issue is the same. Can you confirm the latest LTS kernel (6.18.26) is ok for you? If so, the first 6.19 series kernel I tested was 6.19.11, which was bad, as was 7.0.
View: https://bugzilla.kernel.org/show_bug.cgi?id=221261#c4
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] 5+ messages in thread
end of thread, other threads:[~2026-12-03 16:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 16:42 NFSv4 client: statx() returns EINVAL after readdir on same directory (kernel 7.0.0) kernel.zie66 via Bugspray Bot
2026-12-03 16:42 ` The Linux kernel's regression tracker (Thorsten Leemhuis) via Bugspray Bot
2026-12-03 16:42 ` kernelbugs via Bugspray Bot
2026-12-03 16:42 ` kernel.zie66 via Bugspray Bot
2026-12-03 16:42 ` kernelbugs via Bugspray Bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox