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
Contributor

Description

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.

Contributor Name

Changwei Ye (Datatom, https://www.datatom.com/)

CLA

### Description 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. ### Contributor Name Changwei Ye (Datatom, https://www.datatom.com/) ### CLA - [x] I accept Vitastor CLA agreement: https://git.yourcmc.ru/vitalif/vitastor/src/branch/master/CLA-en.md
changwei.ye added 1 commit 2026-09-01 10:06:21 +03:00
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.
changwei.ye requested review from vitalif 2026-09-01 10:06:21 +03:00
vitalif merged commit cee6882d6e into master 2026-09-05 00:16:46 +03:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vitalif/vitastor#81
No description provided.