vitastor-disk: Refuse a disk given both as data and in --fast-devices #135
Reference in New Issue
Block a user
No description provided.
Delete Branch "koolkhel/vitastor:prepare-fast-data-overlap"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
vitastor-disk preparecollects the device list and--fast-deviceswith two separatecollect_devices()calls, so a disk given in both gets two entries, each with its own copy of the partition table read before anything is created. The two then overwrite each other's new partitions.Seen on loop devices on master with
prepare --hybrid --fast-devices B A B(A is 100G, B is 20G):Failed to open data device /dev/disk/by-partuuid/...: No such file or directory;Now prepare refuses such a command with an error before anything is changed, with
--dry-runtoo.Devices are compared by path, so together with #134 this also covers a disk given under two names. The two PRs do not depend on each other and merge cleanly in either order.
Tested:
test_resize_auto.shandOLD=1 test_resize_auto.shpass on loop devices. The added check fails without the fix.Contributor Name
Yury Luneff (MIND Software LLC, https://mindsw.io)
CLA
koolkhel referenced this pull request2026-11-20 08:39:01 +03:00
koolkhel referenced this pull request2026-11-20 09:45:32 +03:00