Fix size check for journal_offset when sharing meta device #81

Merged
vitalif merged 1 commits from changwei.ye/vitastor:fix-journal-offset-check into master 2026-09-05 00:16:46 +03:00

1 Commits

Author SHA1 Message Date
89132d0fcd Fix size check for journal_offset when sharing meta device
When journal_device and meta_device share the same device, but they
are separate from data_device (e.g., Data on HDD, while Meta and Journal
are on a shared NVMe SSD), the boundary check for journal_offset incorrectly
compared the offset against data_device_size.

This could lead to out-of-bounds I/O on the NVMe SSD if the configured
journal offset was larger than the SSD but smaller than the HDD, or it
could cause false-positive startup failures if the HDD was smaller than
the NVMe SSD.

This fix ensures that journal_offset is appropriately checked against
meta_device_size when it is available (i.e., when meta and data are on
different devices), and falls back to data_device_size only when all
three share the same physical device.
2026-09-01 15:03:25 +08:00