virtiofs: FUSE conn_error on Linux 6.12+ due to ALLOW_IDMAP without POSIX_ACL

未关闭
#568 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

  • #584 来自 @JAORMX —— 已关闭,未合并

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
linux, rust

调研方向

Read src/devices/src/virtio/fs/server.rs and inspect how the FUSE_INIT response flags are assembled, especially the supported flags and the passthrough init() result. The issue identifies the macOS passthrough mismatch; verify the flag behavior against the Linux 6.12+ requirement described here. Done means the response no longer advertises an incompatible flag combination and virtiofs file operations work after mounting.

由索引模型根据 Issue 内容生成。

描述

Summary

On Linux 6.12+ guests, virtiofs mount succeeds but all subsequent file operations return ECONNREFUSED. The root cause is that server.rs advertises FUSE_ALLOW_IDMAP in the FUSE_INIT response without also advertising FUSE_POSIX_ACL.

Root Cause

Linux 6.12 added FUSE_ALLOW_IDMAP support (idmapped FUSE mounts). In fs/fuse/inode.c:process_init_reply, the kernel requires default_permissions (which is only set when FUSE_POSIX_ACL is in the response flags) when FUSE_ALLOW_IDMAP is present:

if (flags & FUSE_ALLOW_IDMAP) {
    if (fc->default_permissions)
        fm->sb->s_iflags &= ~SB_I_NOIDMAP;
    else
        ok = false;  // ← sets conn_error = 1
}

libkrun's src/devices/src/virtio/fs/server.rs (added by #456) includes ALLOW_IDMAP in supported flags but does NOT include POSIX_ACL. The macOS passthrough's init() returns only WRITEBACK_CACHE | SUBMOUNTS. So the computed response flags include ALLOW_IDMAP but not POSIX_ACL, triggering the kernel's conn_error = 1.

With conn_error set, all subsequent FUSE requests return ECONNREFUSED without being sent through the virtqueue, so the FUSE worker only ever sees the FUSE_INIT request.

How to Reproduce

  1. Use libkrun v1.17.0+ on macOS (Apple Silicon)
  2. Boot a Linux 6.12+ kernel (e.g., Docker Desktop's LinuxKit kernel 6.12.72)
  3. Add a virtiofs device with krun_add_virtiofs()
  4. In the guest: mount -t virtiofs <tag> /mnt succeeds
  5. ls /mnt returns Connection refused (ECONNREFUSED)

Suggested Fix

Either:

  • Remove ALLOW_IDMAP from supported flags when the passthrough filesystem doesn't support POSIX ACLs (macOS passthrough)
  • Add POSIX_ACL to supported flags alongside ALLOW_IDMAP (requires the passthrough to actually implement POSIX ACL support)

The first option is simpler and correct since the macOS passthrough doesn't support POSIX ACLs.

Environment

  • libkrun: v1.17.4 (Homebrew, macOS arm64)
  • Host: macOS 15 (Apple Silicon)
  • Guest kernel: Linux 6.12.72-linuxkit (Docker Desktop)
  • FUSE API: 7.41

Debug Evidence

With KRUN_LOG_LEVEL_DEBUG, only one FUSE request is processed:

[devices::virtio::fs::worker] Fs: queue event: 1
[devices::virtio::fs::server] opcode: 26   # FUSE_INIT — the only request ever received
[devices::virtio::mmio[fs]] interrupt: signal_used_queue

No subsequent FUSE requests (LOOKUP, GETATTR, READDIR) arrive at the worker.

主要语言
Rust
星标
2.8k
派生
279
平均合并
5 天 19 小时
30 天内合并 PR
48

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

libkrun/libkrun 的其他 Issue

查看 libkrun/libkrun 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。