It's possible for a dev-cache entry to remain after all
paths for it have been removed, and other parts of the
code expect that a dev always has a name. A better fix
may be to remove a device from dev-cache after all paths
to it have been removed.
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);
{
uint64_t devsize = 0;
+ if (dm_list_empty(&dev->aliases))
+ return 0;
+
if (!cmd->filter->passes_filter(cmd, cmd->filter, dev, "regex"))
return 0;