Fix vitastor-disk build (with old metadata and journal formats)

This commit is contained in:
Vitaliy Filippov
2025-12-02 01:52:12 +03:00
parent 353460cc83
commit 38112e9012
10 changed files with 82 additions and 51 deletions
+3 -4
View File
@@ -107,7 +107,7 @@ int disk_tool_t::upgrade_simple_unit(std::string unit)
dsk.open_data();
dsk.open_meta();
dsk.open_journal();
dsk.calc_lengths(true);
dsk.calc_lengths();
dsk.close_all();
}
catch (std::exception & e)
@@ -116,9 +116,8 @@ int disk_tool_t::upgrade_simple_unit(std::string unit)
fprintf(stderr, "Error: %s\n", e.what());
return 1;
}
options.erase("meta_format");
if (m_is_d && m_o < d_o && d_o-m_o < dsk.meta_len)
d_o += ((dsk.meta_len - (d_o-m_o) + blk-1) / blk) * blk;
if (m_is_d && m_o < d_o && d_o-m_o < dsk.min_meta_len)
d_o += ((dsk.min_meta_len - (d_o-m_o) + blk-1) / blk) * blk;
}
resize["new_data_offset"] = d_o;
resize["new_meta_offset"] = m_o;