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

bugfix: Switch losetup to --direct-io=off by default #487

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

ckyrouac
Copy link
Contributor

When using a loopback device pointing to a file on a 9p filesystem (e.g. the home mount of a podman machine), using direct-io=on causes the partitioning via sgdisk to fail. This is a temporary fix until podman machine switches away from 9p or another fix is found. Direct IO can be enabled via the BOOTC_DIRECT_IO=on environment variable.

Fixes #485

@ckyrouac ckyrouac requested a review from cgwalters April 25, 2024 15:43
Comment on lines 87 to 96
let direct_io = match env::var("BOOTC_DIRECT_IO") {
Ok(val) => {
if val == "on" { "on" } else { "off" }
},
Err(_e) => {
"off"
},
};
Copy link
Collaborator

@cgwalters cgwalters Apr 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, it seems simpler to pass through the variable if present directly to the command...something like:

        let direct_io_arg = env::var_os("BOOTC_INSTALL_DIRECT_IO").map(|v| format!("--direct-io={v:?}");
...
     .args(["--show", "-P", "--find"])
     .arg(direct_io_arg)

or so? (not tested)

@cgwalters
Copy link
Collaborator

I'm ok with this as too, but missing a cargo fmt

When using a loopback device pointing to a file on a 9p filesystem (e.g.
the home mount of a podman machine), using direct-io=on causes the
partitioning via sgdisk to fail. This is a temporary fix until podman
machine switches away from 9p or another fix is found. Direct IO can be
enabled via the BOOTC_DIRECT_IO=on environment variable.

Fixes containers#485

Signed-off-by: Chris Kyrouac <ckyrouac@redhat.com>
@ckyrouac ckyrouac enabled auto-merge April 25, 2024 17:36
@ckyrouac ckyrouac merged commit c2d838e into containers:main Apr 25, 2024
14 of 17 checks 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.

bootc install to-disk --via-loopback fails when pointing to file mounted over virtfs
2 participants