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

nativeimgutil: fix making a sparse file #2715

Closed
wants to merge 2 commits into from

Conversation

AkihiroSuda
Copy link
Member

"Expanding to 100GiB" phase was making a non-sparse 100GiB image

FIx #2713

jandubois
jandubois previously approved these changes Oct 10, 2024
Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

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

It looks good, except for the potential file handle leak.

I've tested it, and I could create a 5GB fedora VZ image in a 6GB RAM disk (on macOS aarch64).

pkg/nativeimgutil/nativeimgutil.go Show resolved Hide resolved
`os.(*File).Truncate` can be used directly

Signed-off-by: Akihiro Suda <[email protected]>
"Expanding to 100GiB" phase was making a non-sparse 100GiB image

Fix issue 2713

Signed-off-by: Akihiro Suda <[email protected]>
@jandubois
Copy link
Member

Sorry, I need to do more testing, but ran out of time for today. Will try again tomorrow.

It turns out that I was testing on a RAM disk formatted with HFS+, which does not support sparse files (thanks @nirs for pointing me at that possibility).

I thought I tested it again with this PR, and that it then worked, but I can no longer reproduce it. Need to retest all scenarios once more.

@jandubois
Copy link
Member

I've tested it, and I could create a 5GB fedora VZ image in a 6GB RAM disk (on macOS aarch64).

Ok, I was obviously confused for that one, as that is not a valid test of creating a sparse image.

@AkihiroSuda AkihiroSuda marked this pull request as draft October 11, 2024 06:36
@AkihiroSuda
Copy link
Member Author

We may rather merge:

@AkihiroSuda AkihiroSuda removed this from the v1.0 milestone Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vz: "Expanding to 100GiB" phase makes a non-sparse 100GiB image
2 participants