All of lore.kernel.org
 help / color / mirror / Atom feed
* 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

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 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.