mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-11 09:18:25 +03:00
pvscan lvmetad: use full md filter when md 1.0 devices are present
Apply the same logic to pvscan/lvmetad that was added to
the non-lvmetad label_scan in commit 3fd75d1b
:
scan: use full md filter when md 1.0 devices are present
Before scanning, check if any of the devs on the system are
md 0.90/1.0, and if so make the scan read both the start and
the end of the device so that the components of those md
versions can be ignored.
This commit is contained in:
parent
0e42ebd6d4
commit
a01e1fec0f
@ -18,6 +18,8 @@
|
||||
#include "lvmetad.h"
|
||||
#include "lvmcache.h"
|
||||
|
||||
extern int use_full_md_check;
|
||||
|
||||
struct pvscan_params {
|
||||
int new_pvs_found;
|
||||
int pvs_found;
|
||||
@ -302,6 +304,7 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv)
|
||||
struct dm_list found_vgnames;
|
||||
struct device *dev;
|
||||
struct device_list *devl;
|
||||
struct dev_iter *iter;
|
||||
const char *pv_name;
|
||||
const char *reason = NULL;
|
||||
int32_t major = -1;
|
||||
@ -443,6 +446,22 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv)
|
||||
/* Creates a list of dev names from /dev, sysfs, etc; does not read any. */
|
||||
dev_cache_scan();
|
||||
|
||||
/* See the same check in label_scan() to handle md 0.9/1.0 components. */
|
||||
if (!(iter = dev_iter_create(cmd->full_filter, 0))) {
|
||||
log_error("Scanning failed to get devices.");
|
||||
return 0;
|
||||
}
|
||||
while ((dev = dev_iter_get(iter))) {
|
||||
if (dev_is_md_with_end_superblock(cmd->dev_types, dev)) {
|
||||
cmd->use_full_md_check = 1;
|
||||
use_full_md_check = 1;
|
||||
log_debug("Found md with end superblock %s", dev_name(dev));
|
||||
}
|
||||
}
|
||||
dev_iter_destroy(iter);
|
||||
if (!use_full_md_check)
|
||||
log_debug("No md devs with end superblock");
|
||||
|
||||
dm_list_init(&single_devs);
|
||||
|
||||
while (argc--) {
|
||||
|
Loading…
Reference in New Issue
Block a user