vitastor-disk: make update-sb write only the given parameters and check them #188

Open
koolkhel wants to merge 4 commits from koolkhel/vitastor:disk-update-sb-checks into master

4 Commits

Author SHA1 Message Date
fb3de0efd8 vitastor-disk: make update-sb check the layout lengths like the OSD does
update-sb checked the new parameters with calc_lengths() only, so for
example --journal_size 1T was written and the OSD then refused to start
with "Requested journal_size is too large". Also run check_lengths(),
as the OSD does after calc_lengths(). dump-meta keeps the lighter check,
so it can still read an OSD that doesn't start.
2026-11-26 13:54:06 +03:00
350485469a vitastor-disk: make update-sb skip --io, which isn't an OSD parameter
--io only sets how vitastor-disk itself opens the devices, but update-sb
wrote it into the superblock too, for example "io": "cached". Leave it
out like --force.
2026-11-26 06:06:23 +03:00
847178c67c vitastor-disk: make update-sb check the new parameters unless --force is given
update-sb wrote any value, so for example --meta_block_size 4294967296
left an OSD that refused to start. Load the resulting parameters the way
dump-meta does (parse them, open the devices, calculate the layout) and
refuse to write them if that fails, leaving the superblock as it was.
--force writes them anyway, as it already skips the superblock validation.
2026-11-25 18:14:21 +03:00
c7fbfa9c21 vitastor-disk: make update-sb write only the given parameters
update-sb copied every entry of the tool's options into the superblock.
read_osd_superblock() looks options["io"] up with operator[], which adds
an empty "io", so every update-sb also wrote "io": "" into the
superblock. Copy the requested parameters before reading the superblock.
2026-11-25 18:09:25 +03:00