Commit 8a7f4b5b authored by Masato Suzuki's avatar Masato Suzuki Committed by Karel Zak

blkzone: fix report zones sector offset check

To catch an offset error, an offset should be begger than or equal to
a device size in the condition.
Signed-off-by: 's avatarMasato Suzuki <masato.suzuki@wdc.com>
parent 8b58ffdd
......@@ -179,8 +179,9 @@ static int blkzone_report(struct blkzone_control *ctl)
fd = init_device(ctl, O_RDONLY);
if (ctl->offset > ctl->total_sectors)
errx(EXIT_FAILURE, _("%s: offset is greater than device size"), ctl->devname);
if (ctl->offset >= ctl->total_sectors)
errx(EXIT_FAILURE,
_("%s: offset is greater than or equal to device size"), ctl->devname);
zonesize = blkdev_chunk_sectors(ctl->devname);
if (!zonesize)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment