cmd_image_update: Fix truncate call at the start of update
Some checks failed
build / bcachefs-tools-deb (ubuntu-22.04) (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-24.04) (push) Has been cancelled
build / bcachefs-tools-rpm (push) Has been cancelled
build / bcachefs-tools-msrv (push) Has been cancelled
Nix Flake actions / nix-matrix (push) Has been cancelled
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Has been cancelled

We don't want to make the image smaller until we've finished updating.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2025-07-15 16:53:23 -04:00
parent e1e87f53cd
commit 5f92627783

View File

@ -635,7 +635,7 @@ static int image_update(const char *src_path, const char *dst_image,
u64 input_bytes = count_input_size(src_fd);
if (truncate(dst_image, input_bytes * 2))
if (truncate(dst_image, xstat(dst_image).st_size + input_bytes * 2))
die("truncate error: %m");
darray_const_str device_paths = {};