You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cli: Fix FUSE kernel cache serving stale directory listings
When readdirplus populates the kernel dcache with TTL=MAX, the
kernel caches those entries indefinitely. After unlink/rmdir/
rename the kernel drops the specific entry it operated on, but
the parent directory's cached readdirplus result can still contain
stale entries on subsequent ls calls.
This was most visible in overlay mode: after whiteout-deleting a
base file, ls still showed the file because the kernel served
the cached readdirplus result without re-querying userspace.
Fix by sending Notifier::inval_entry to the kernel after unlink,
rmdir, and rename so the dcache drops the affected entry. These
notifications cannot be issued from inside FUSE callbacks because
the kernel may synchronously respond with FUSE_FORGET, which the
single-threaded session loop cannot process until the current
callback returns -- deadlocking the mount.
Instead, callbacks enqueue invalidation requests into a
DeferredNotifier (mpsc channel) that a background thread drains
and writes to /dev/fuse. The session loop remains free to read
FUSE_FORGET while the notification thread writes.
Add test-fuse-cache-invalidation.sh covering unlink, rmdir,
rename, create, and mkdir visibility in subsequent readdir.
0 commit comments