diff --git a/lib/device/dev-io.c b/lib/device/dev-io.c index 735441f19..33b9345ee 100644 --- a/lib/device/dev-io.c +++ b/lib/device/dev-io.c @@ -86,6 +86,9 @@ static int _dev_get_size_dev(struct device *dev, uint64_t *size) int fd = dev->bcache_fd; int do_close = 0; + if (dm_list_empty(&dev->aliases)) + return 0; + if (dev->size_seqno == _dev_size_seqno) { log_very_verbose("%s: using cached size %" PRIu64 " sectors", name, dev->size); diff --git a/lib/label/hints.c b/lib/label/hints.c index 48fb661b4..349d5aaef 100644 --- a/lib/label/hints.c +++ b/lib/label/hints.c @@ -419,6 +419,9 @@ static int _dev_in_hint_hash(struct cmd_context *cmd, struct device *dev) { uint64_t devsize = 0; + if (dm_list_empty(&dev->aliases)) + return 0; + if (!cmd->filter->passes_filter(cmd, cmd->filter, dev, "regex")) return 0;