fix(fuse) support FUSE submounts and fix virtiofs mount semantics#1968
fix(fuse) support FUSE submounts and fix virtiofs mount semantics#1968xboHodx wants to merge 21 commits into
Conversation
c3e8983 to
b029c4e
Compare
83398cc to
b7eb76c
Compare
当前pr的临时修复
这可以修复一部分问题,尤其是避免把 |
- Enhance the sys_mount implementation to support various mount operations including bind mounts and remounts, with improved handling of mount flags and target paths. - Introduce new tests for FUSE to validate behavior with zero file handles, fsync operations without open, and correct handling of open flags in accordance with Linux standards. - Update the simple filesystem structure to accommodate open file handles and flags, ensuring compatibility with the extended FUSE operations. - Refactor FUSE daemon handling to track and validate file handle usage during open, read, write, and release operations, improving robustness and correctness of the FUSE interface. Signed-off-by: xboHodx <2679933924@qq.com>
b7eb76c to
5177f9e
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5177f9e70b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
Signed-off-by: longjin <longjin@dragonos.org>
…, and direct I/O lock-owner - Cache ENOSYS for FUSE_FLUSH, FUSE_FSYNC, FUSE_FSYNCDIR to avoid repeated round-trips when the daemon does not implement these ops - Move FUSE_FLUSH from IndexNode::close to new flush_file(), called at fd-close time so errors propagate to userspace via close(2) - Send FUSE_RELEASE asynchronously via request_nocreds_background to prevent close(2) from blocking on daemon release replies - Add DroppedFd deferred-close mechanism: flush + posix-lock release happen after fd-table lock is dropped, fixing lock-ordering issues - Pass lock_owner in FUSE_READ/FUSE_WRITE with FUSE_READ_LOCKOWNER / FUSE_WRITE_LOCKOWNER flags for direct I/O - Add FuseOpenContext capturing request cred, lock owner, node generation, and writeback error cursor at open time - Validate node generation on writeback writes to detect stale handles - Add direct_io_lock per FuseNode and prepare_direct_io_range for cache invalidation before direct I/O writes - Check and advance per-open writeback errors in fsync/flush paths - Add dunitest coverage for ENOSYS caching, flush error propagation, and close semantics Signed-off-by: longjin <longjin@dragonos.org>
8bce03f to
8eb9d40
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8eb9d407d6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Add request_with_cred to FuseConn so write requests carry the open-time credentials (pid/uid/gid) to the FUSE daemon, matching Linux semantics. - Replace invalidate_read + update_clean_page with update_ready_page in the write path: instead of discarding the whole page cache on every write, merge written data into existing up-to-date pages so that overlapping mmap reads see the latest bytes. - Acquire the page-cache invalidate-write lock around cached writes and wait for any in-flight writeback in the overlapping range before issuing the FUSE_WRITE to prevent stale writeback from overwriting newer data. - Move invalidate_read into prepare_*_writeback_entry so that page faults are blocked during the state transition, not after the page contents have already been read. - Add dunitest SharedMmapDirtyThenPwriteKeepsLatestData verifying that pwrite over a dirty mmap page updates the page cache and that the subsequent msync writes back the latest (pwrite) data. - Extend the msync writeback test to assert that write requests carry the same pid as the preceding open. Signed-off-by: longjin <longjin@dragonos.org>
主要改动
FUSE_SUBMOUNTS和FUSE_ATTR_SUBMOUNT支持,在 lookup 到子挂载标记目录时自动创建 DragonOS 子挂载。FuseNode状态:ESTALE;FUSE_WRITEBACK_CACHE,避免语义不完整。O_CREAT/O_EXCL/O_NOCTTY;FUSE_ATOMIC_O_TRUNC不支持时过滤O_TRUNC;fh=0;fuse:<nodeid>之类 synthetic path 破坏路径重写。测试
新增/扩展 FUSE dunitest 覆盖:
FuseExtended.OpenReturnsZeroFhIsValidFuseExtended.NoOpenFsyncUsesZeroFhFuseExtended.OpenFlagsMatchLinuxMaskFuseExtended.InitRequestsLinuxNoOpenSupport同时扩展 simple FUSE test daemon,支持记录 open/read/write/fsync/release 的 fh、flags 和计数,用于验证 Linux 兼容行为。