From 9d5fe35d0f8243b27f7603d6142341e266864050 Mon Sep 17 00:00:00 2001 From: Yury Luneff Date: Tue, 17 Nov 2026 21:07:03 +0300 Subject: [PATCH] vitastor-disk: Write csum_block_size 0 in JE_START without data checksums With a manual layout, write-journal takes data_csum_type and csum_block_size from the JSON "start" entry and otherwise keeps the blockstore_disk_t defaults. calc_lengths(), which zeroes csum_block_size when there are no checksums, is not run for a manual layout. So a JSON without a "start" entry produced JE_START with data_csum_type none and csum_block_size 4096, and raw-resize then refused the journal: "journal header has different checksum parameters: none/4096 vs none/0". Zero csum_block_size when there are no data checksums. --- src/disk_tool/disk_tool.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/disk_tool/disk_tool.cpp b/src/disk_tool/disk_tool.cpp index 166b3f0f..3028e716 100644 --- a/src/disk_tool/disk_tool.cpp +++ b/src/disk_tool/disk_tool.cpp @@ -372,6 +372,11 @@ int main(int argc, char *argv[]) { self.dsk.csum_block_size = stoull_full(self.options["csum_block_size"], 0); } + if (!self.dsk.data_csum_type) + { + // A manual layout skips calc_lengths() which zeroes the 4096 default + self.dsk.csum_block_size = 0; + } if (self.options["io"] != "") { self.dsk.data_io = self.dsk.meta_io = self.dsk.journal_io = self.options["io"]; -- 2.47.3