1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

hints: fix case of error getting device size

When checking hints, if there's an error getting
the device size, that should be equivalent to
seeing zero size.
This commit is contained in:
David Teigland 2019-04-11 10:32:28 -05:00
parent 25f231cf06
commit 0cc80ccfd5

View File

@ -414,7 +414,7 @@ static int _dev_in_hint_hash(struct cmd_context *cmd, struct device *dev)
if (!cmd->scan_lvs && dm_is_dm_major(MAJOR(dev->dev)) && dev_is_lv(dev))
return 0;
if (dev_get_size(dev, &devsize) && !devsize)
if (!dev_get_size(dev, &devsize) || !devsize)
return 0;
return 1;
@ -604,6 +604,8 @@ static int _read_hint_file(struct cmd_context *cmd, struct dm_list *hints, int *
if (!(fp = fopen(_hints_file, "r")))
return 0;
log_debug("Reading hint file");
for (i = 0; i < HINT_LINE_WORDS; i++)
split[i] = NULL;