Skip to content

fix(slayerfs): unify session usage in unprivileged mount#575

Open
Ivanbeethoven wants to merge 3 commits intork8s-dev:mainfrom
Ivanbeethoven:codex/evaluate-issue-551-and-create-score
Open

fix(slayerfs): unify session usage in unprivileged mount#575
Ivanbeethoven wants to merge 3 commits intork8s-dev:mainfrom
Ivanbeethoven:codex/evaluate-issue-551-and-create-score

Conversation

@Ivanbeethoven
Copy link
Copy Markdown
Collaborator

Motivation

  • Allow filesystem code to send FUSE kernel cache invalidation notifications after mutating operations so clients see updates promptly.
  • Propagate a clonable Notify handle from the FUSE Session/MountHandle into the VFS layer so async operations can trigger cache invalidation without tight coupling.

Description

  • Made MountHandle carry a notify: Notify and added MountHandle::notify() to return a clonable notifier.
  • Made Session::notify() public (replacing get_notify) and switched internal uses (e.g. handle_poll) to call the public method.
  • In slayerfs::mount_vfs_unprivileged, create the Session first and call fs.set_fuse_notify(session.notify()).await so the VFS receives the notifier before mounting.
  • Added fuse_notify: Arc<RwLock<Option<FuseNotify>>> to VFS and initialized it in the constructor, plus set_fuse_notify to store the notifier.
  • Added VFS::invalidate_entry_cache(parent, name) and VFS::invalidate_inode_cache(inode) which call into the stored Notify when present.
  • Inserted calls to invalidate_entry_cache or invalidate_inode_cache in FUSE operation handlers that mutate namespace or metadata (setattr, mkdir, create, link, symlink, unlink, rmdir, rename) so kernel caches are invalidated after successful changes.
  • Minor async/locking import adjustments (RwLock) and small control-flow fixes to return Ok(()) where appropriate after performing invalidations.

Testing

  • Built the workspace with cargo build --workspace to verify compilation; build succeeded.
  • Ran unit tests for the filesystem crate with cargo test -p slayerfs; tests passed locally.
  • Ran unit tests for the rfuse3 crate with cargo test -p rfuse3; tests passed locally.

link to #551

Codex Task

Signed-off-by: Luxian <lux1an@qq.com>
@Ivanbeethoven Ivanbeethoven force-pushed the codex/evaluate-issue-551-and-create-score branch from 7e9c07a to 8a0e5d2 Compare April 12, 2026 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants