Fix vitastor-disk resize to smaller size clearing all data O_o, add a test for it

This commit is contained in:
Vitaliy Filippov
2026-06-10 00:30:42 +03:00
parent c16f955a51
commit 334755e912
4 changed files with 23 additions and 9 deletions
+2 -2
View File
@@ -97,9 +97,9 @@ struct snap_flattener_t
{ "from", top_parent_name },
{ "to", target_name },
{ "target", target_name },
{ "delete-source", false },
{ "delete_source", false },
{ "cas", use_cas },
{ "fsync-interval", fsync_interval },
{ "fsync_interval", fsync_interval },
});
// Wait for it
resume_1:
+3 -3
View File
@@ -110,9 +110,9 @@ struct image_changer_t
cb = parent->start_rm_data(json11::Json::object {
{ "inode", INODE_NO_POOL(inode_num) },
{ "pool", (uint64_t)INODE_POOL(inode_num) },
{ "fsync-interval", fsync_interval },
{ "min-offset", ((new_size+4095)/4096)*4096 },
{ "down-ok", down_ok },
{ "fsync_interval", fsync_interval },
{ "min_offset", ((new_size+4095)/4096)*4096 },
{ "down_ok", down_ok },
});
resume_1:
while (!cb(result))
+4 -4
View File
@@ -636,9 +636,9 @@ resume_100:
{ "from", from_name },
{ "to", child_it->second.name },
{ "target", target_it->second.name },
{ "delete-source", false },
{ "delete_source", false },
{ "cas", use_cas },
{ "fsync-interval", fsync_interval },
{ "fsync_interval", fsync_interval },
});
}
@@ -677,8 +677,8 @@ resume_100:
cb = parent->start_rm_data(json11::Json::object {
{ "inode", inode },
{ "pool", (uint64_t)INODE_POOL(inode) },
{ "fsync-interval", fsync_interval },
{ "down-ok", down_ok },
{ "fsync_interval", fsync_interval },
{ "down_ok", down_ok },
});
}
};