Refuse an invalid --resize value in vitastor-cli modify #98

Merged
vitalif merged 1 commits from koolkhel/vitastor:cli-modify-resize into master 2026-10-25 17:20:18 +03:00
Contributor

Description

parse_size() returns 0 for a value it cannot parse, such as 1.5G, and
modify took 0 as "no resize": it printed "No change" and exited with 0.
Check the parse result and fail with EINVAL, as create does for --size.
Numeric sizes passed by internal callers (NFS, dd) parse as before.

Tested: new tests/test_modify_image_resize.sh (--resize 1.5G, 10X, abc, empty), fails without the fix and passes with it.

Contributor Name

Yury Luneff (MIND Software LLC, https://mindsw.io)

CLA

### Description parse_size() returns 0 for a value it cannot parse, such as 1.5G, and modify took 0 as "no resize": it printed "No change" and exited with 0. Check the parse result and fail with EINVAL, as create does for --size. Numeric sizes passed by internal callers (NFS, dd) parse as before. Tested: new tests/test_modify_image_resize.sh (`--resize 1.5G`, `10X`, `abc`, empty), fails without the fix and passes with it. ### Contributor Name Yury Luneff (MIND Software LLC, https://mindsw.io) ### CLA - [x] I accept Vitastor CLA agreement: https://git.yourcmc.ru/vitalif/vitastor/src/branch/master/CLA-en.md
koolkhel added 1 commit 2026-10-25 16:14:50 +03:00
parse_size() returns 0 for a value it cannot parse, such as 1.5G, and
modify took 0 as "no resize": it printed "No change" and exited with 0.
Check the parse result and fail with EINVAL, as create does for --size.
Numeric sizes passed by internal callers (NFS, dd) parse as before.
vitalif merged commit 5a6343f21d into master 2026-10-25 17:20:18 +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#98
No description provided.