Skip to content

NFS exporting mergerfs with a mix of RO and RW mounts and func.readdir=cor will randomly list the same file twice #1589

@slqy123

Description

@slqy123

Describe the bug & To Reproduce
I have /mnt/disk-ro/p* mounted ro, and /mnt/disk/d* mounted rw

all the disks are mounted with:
UUID=xxx /mnt/disk/p1 btrfs <rw/ro>,users,autodefrag,noatime,compress=zstd 0 0

mergerfs mount:
/mnt/disk-ro/*=RO:/mnt/disk/d* /mnt/all mergerfs config=/etc/mergerfs/default.ini 0 0

/etc/mergerfs/default.ini:
cache.files=off
dropcacheonclose=false
func.readdir=cor:4
func.getattr=newest
category.create=mspmfs
minfreespace=16G
never-forget-nodes=true
inodecalc=path-hash
lazy-umount-mountpoint=false

nfs exports:
/mnt/all *(rw,sync,fsid=691a181c-a718-44a7-a0fd-50e5a9c08bae,insecure,nohide,no_root_squash)
  1. create example files in every disk
  2. export with NFS and keep trying ls on client side
  3. Sometimes ls will show:
# d1-1 ~ d1-7 are missing
12063579590297766028 .rw-r--r--@ 0 quy 23 Nov 17:30 d1-8
 1009218104580372872 .rw-r--r--@ 0 quy 23 Nov 17:30 d1-9
10226916096750517555 .rw-r--r--@ 0 quy 23 Nov 17:30 d2-0
 9148699206468856763 .rw-r--r--@ 0 quy 23 Nov 17:30 d2-1
...
 3995154008875108500 .rw-r--r--@ 0 quy 23 Nov 17:30 p2-6    <--
 3995154008875108500 .rw-r--r--@ 0 quy 23 Nov 17:30 p2-6    <-- p2-6 show twice
 4991125370245759905 .rw-r--r--@ 0 quy 23 Nov 17:30 p2-7
 4991125370245759905 .rw-r--r--@ 0 quy 23 Nov 17:30 p2-7
 4736725953109485646 .rw-r--r--@ 0 quy 23 Nov 17:30 p2-8
 7456473207889864599 .rw-r--r--@ 0 quy 23 Nov 17:30 p2-9
# the total amount of files is correct

but when I use func.readdir=cosr, everything is OK.

System information:

  • OS, kernel version: ArchLinux, Linux PC 6.17.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 14 Nov 2025 06:54:20 +0000 x86_64 GNU/Linux
  • mergerfs version: mergerfs v2.41.0
  • mergerfs settings: see above
  • A strace of the application having a problem: app.strace.txt
  • strace of mergerfs while app tried to do it's thing: mergerfs.strace.txt

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions