Skip to content

feat(mount): add data field to MountSpec#91

Draft
noeljackson wants to merge 1 commit intoedera-dev:mainfrom
noeljackson:feat/mount-data
Draft

feat(mount): add data field to MountSpec#91
noeljackson wants to merge 1 commit intoedera-dev:mainfrom
noeljackson:feat/mount-data

Conversation

@noeljackson
Copy link

Summary

Add an optional data: Option<String> field to MountSpec and pass it through to the mount(2) syscall. This enables mount options that require the data argument, such as size=64m for tmpfs or filesystem-specific options.

Changes

  1. config.rs: Add data: Option<String> field to MountSpec struct.

  2. mount.rs:

    • Pass the data field to mount(2) as the 5th argument (was always ptr::null()).
    • Improve the error message on mount failure to include source, target, fstype, bind flag, and flags hex value. The previous error was just unable to mount with no context.
    • Fix create_mountpoint for bind mounts: when the source is a non-directory (e.g., a device node or regular file), create an empty file at the target instead of a directory. Bind-mounting a file onto a directory fails with EINVAL.

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.

1 participant