From: "kernel.zie66 via Bugspray Bot" <bugbot@kernel.org>
To: linux-nfs@vger.kernel.org, anna@kernel.org, cel@kernel.org,
jlayton@kernel.org, trondmy@kernel.org
Subject: NFSv4 client: statx() returns EINVAL after readdir on same directory (kernel 7.0.0)
Date: Thu, 03 Dec 2026 16:42:32 +0000 [thread overview]
Message-ID: <20261203-b221261c0-40c5a906b999@bugzilla.kernel.org> (raw)
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)
next reply other threads:[~2026-12-03 16:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 16:42 kernel.zie66 via Bugspray Bot [this message]
2026-12-03 16:42 ` NFSv4 client: statx() returns EINVAL after readdir on same directory (kernel 7.0.0) 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
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=20261203-b221261c0-40c5a906b999@bugzilla.kernel.org \
--to=bugbot@kernel.org \
--cc=anna@kernel.org \
--cc=cel@kernel.org \
--cc=jlayton@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 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.