mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
Never scan internal LVM devices.
This commit is contained in:
parent
0ae41c4412
commit
f3ad0dcfde
@ -153,12 +153,17 @@ int device_is_usable(struct device *dev)
|
|||||||
if (!dm_task_get_info(dmt, &info))
|
if (!dm_task_get_info(dmt, &info))
|
||||||
goto_out;
|
goto_out;
|
||||||
|
|
||||||
if (!info.exists || info.suspended)
|
if (!info.exists)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
name = dm_task_get_name(dmt);
|
name = dm_task_get_name(dmt);
|
||||||
uuid = dm_task_get_uuid(dmt);
|
uuid = dm_task_get_uuid(dmt);
|
||||||
|
|
||||||
|
if (info.suspended && ignore_suspended_devices()) {
|
||||||
|
log_debug("%s: Suspended device %s not usable.", dev_name(dev), name);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME Also check for mirror block_on_error and mpath no paths */
|
/* FIXME Also check for mirror block_on_error and mpath no paths */
|
||||||
/* For now, we exclude all mirrors */
|
/* For now, we exclude all mirrors */
|
||||||
|
|
||||||
@ -166,8 +171,8 @@ int device_is_usable(struct device *dev)
|
|||||||
next = dm_get_next_target(dmt, next, &start, &length,
|
next = dm_get_next_target(dmt, next, &start, &length,
|
||||||
&target_type, ¶ms);
|
&target_type, ¶ms);
|
||||||
/* Skip if target type doesn't match */
|
/* Skip if target type doesn't match */
|
||||||
if (target_type && !strcmp(target_type, "mirror")) {
|
if (target_type && !strcmp(target_type, "mirror") && ignore_suspended_devices()) {
|
||||||
log_debug("%s: Mirror device not usable.", dev_name(dev));
|
log_debug("%s: Mirror device %s not usable.", dev_name(dev), name);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
} while (next);
|
} while (next);
|
||||||
|
@ -279,8 +279,8 @@ static int _lookup_p(struct dev_filter *f, struct device *dev)
|
|||||||
if (!l)
|
if (!l)
|
||||||
dm_list_iterate_items(sl, &dev->aliases)
|
dm_list_iterate_items(sl, &dev->aliases)
|
||||||
dm_hash_insert(pf->devices, sl->str, PF_GOOD_DEVICE);
|
dm_hash_insert(pf->devices, sl->str, PF_GOOD_DEVICE);
|
||||||
if (ignore_suspended_devices() && !device_is_usable(dev)) {
|
if (!device_is_usable(dev)) {
|
||||||
log_debug("%s: Skipping (suspended/internal)", dev_name(dev));
|
log_debug("%s: Skipping unusable device", dev_name(dev));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return pf->real->passes_filter(pf->real, dev);
|
return pf->real->passes_filter(pf->real, dev);
|
||||||
|
Loading…
Reference in New Issue
Block a user