1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

scan: handle request to scan missing dev

This commit is contained in:
David Teigland 2018-02-13 16:17:02 -06:00
parent 89f54a5094
commit e4f478d86d

View File

@ -257,6 +257,8 @@ struct bcache *scan_bcache;
static bool _in_bcache(struct device *dev) static bool _in_bcache(struct device *dev)
{ {
if (!dev)
return NULL;
return (dev->flags & DEV_IN_BCACHE) ? true : false; return (dev->flags & DEV_IN_BCACHE) ? true : false;
} }
@ -402,6 +404,9 @@ static int _scan_dev_open(struct device *dev)
int flags = 0; int flags = 0;
int fd; int fd;
if (!dev)
return 0;
if (dev->flags & DEV_IN_BCACHE) { if (dev->flags & DEV_IN_BCACHE) {
log_error("scan_dev_open %s DEV_IN_BCACHE already set", dev_name(dev)); log_error("scan_dev_open %s DEV_IN_BCACHE already set", dev_name(dev));
dev->flags &= ~DEV_IN_BCACHE; dev->flags &= ~DEV_IN_BCACHE;