Skip to content

New mount API: implement fsopen(2), fsconfig(2), fsmount(2), move_mount(2).#13350

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test/cl923640824
Open

New mount API: implement fsopen(2), fsconfig(2), fsmount(2), move_mount(2).#13350
copybara-service[bot] wants to merge 1 commit into
masterfrom
test/cl923640824

Conversation

@copybara-service
Copy link
Copy Markdown

New mount API: implement fsopen(2), fsconfig(2), fsmount(2), move_mount(2).

The first step in implementing the new file-descriptor based mount API in
gVisor. A "filesystem creation context" is created using fsopen(). The context
is then configured using fsconfig(), and the FSCONFIG_CMD_CREATE command is
used to create a filesystem. A "mount object" can be obtained using fsmount(),
which can be operated on directly using the *at() functions or mounted onto the
real directory tree using move_mount().

For compatibility reasons, the new mount API is gated behind the runtime flag
--new-mount-api, which is disabled by default.

The current implementation has the following limitations:

  • Linux passes configuration options to filesystems on-the-fly as fsopen() and
    fsconfig() are called, allowing per-parameter error handling. gVisor
    currently queues up all options and passes them to the filesystem all-at-once
    when FSCONFIG_CMD_CREATE occurs. Lifting this will require refactoring the
    option parsing for all existing filesystems.
  • Only flag and string arguments to fsconfig() are supported.
  • Reconfiguration of the filesystem through fsconfig() is not supported.
  • move_mount(): flags MOVE_MOUNT_SET_GROUP and MOVE_MOUNT_BENEATH are not
    supported.
  • The filesystem context message retrieval interface is not supported.

In the interest of review size, there is no implementation yet for
open_tree(2) or fspick(2).

@copybara-service copybara-service Bot added the exported Issue was exported automatically label Jun 2, 2026
@copybara-service copybara-service Bot force-pushed the test/cl923640824 branch 3 times, most recently from c213366 to 4d0f1eb Compare June 2, 2026 23:38
…nt(2).

The first step in implementing the new file-descriptor based mount API in
gVisor. A "filesystem creation context" is created using fsopen(). The context
is then configured using fsconfig(), and the FSCONFIG_CMD_CREATE command is
used to create a filesystem. A "mount object" can be obtained using fsmount(),
which can be operated on directly using the *at() functions or mounted onto the
real directory tree using move_mount().

For compatibility reasons, the new mount API is gated behind the runtime flag
`--new-mount-api`, which is disabled by default.

The current implementation has the following limitations:
- Linux passes configuration options to filesystems on-the-fly as fsopen() and
  fsconfig() are called, allowing per-parameter error handling. gVisor
  currently queues up all options and passes them to the filesystem all-at-once
  when FSCONFIG_CMD_CREATE occurs. Lifting this will require refactoring the
  option parsing for all existing filesystems.
- Only flag and string arguments to fsconfig() are supported.
- Reconfiguration of the filesystem through fsconfig() is not supported.
- move_mount(): flags MOVE_MOUNT_SET_GROUP and MOVE_MOUNT_BENEATH are not
  supported.
- The filesystem context message retrieval interface is not supported.

In the interest of review size, there is no implementation yet for
open_tree(2) or fspick(2).

PiperOrigin-RevId: 923640824
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant