Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable puzzlefs to be used as a MOUNT_HELPER in the LXC OCI template #133

Merged
merged 3 commits into from
Oct 6, 2024

Conversation

ariel-miculas
Copy link
Collaborator

The mount-helper is called like this:
mount-helper mount --writable <oci_dir>:<oci_name> mount-helper umount

I've added the support for the --writable flag that creates a writable overlay on top of a PuzzleFS mountpoint (used as a lowerdir). This requires root privileges.

I've also added the support for the umount subcommand which detects whether the puzzlefs filesystem was mounted as a read-only fuse driver or whether an overlay was created on top of it, and handles the unmounting accordingly. Unmounting an overlay requires root privileges.

I've implemented the changes on the LXC side in [1].

[1] lxc/lxc#4483

The mount-helper is called like this:
mount-helper mount --writable <oci_dir>:<oci_name> <mountpoint>
mount-helper umount <mountpoint>

I've added the support for the `--writable` flag that creates a writable
overlay on top of a PuzzleFS mountpoint (used as a lowerdir). This
requires root privileges.

I've also added the support for the `umount` subcommand which detects
whether the puzzlefs filesystem was mounted as a read-only fuse driver
or whether an overlay was created on top of it, and handles the
unmounting accordingly. Unmounting an overlay requires root privileges.

I've implemented the changes on the LXC side in [1].

[1] lxc/lxc#4483

Signed-off-by: Ariel Miculas-Trif <[email protected]>
Fix the following errors reported by clippy:
```
error: manual arithmetic check found
  --> puzzlefs-lib/src/reader/puzzlefs.rs:45:27
   |
45 |           let addl_offset = if offset > file_offset {
   |  ___________________________^
46 | |             offset - file_offset
47 | |         } else {
48 | |             0
49 | |         };
   | |_________^ help: replace it with: `offset.saturating_sub(file_offset)`
      |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub
   = note: `-D clippy::implicit-saturating-sub` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::implicit_saturating_sub)]`
```

and ignore the needless-lifetimes errors reported on the autogenerated
capnp code:

```
   |
15 |   impl <'a,> ::core::marker::Copy for Reader<'a,>  {}
   |         ^^                                   ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
   = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]`
help: elide the lifetimes
   |
15 -   impl <'a,> ::core::marker::Copy for Reader<'a,>  {}
15 +   impl  ::core::marker::Copy for Reader<'_,>  {}
   |
```

Signed-off-by: Ariel Miculas-Trif <[email protected]>
@hallyn hallyn merged commit 79fefdd into project-machine:master Oct 6, 2024
1 check passed
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.

3 participants