mirror of
git://sourceware.org/git/lvm2.git
synced 2025-10-18 03:33:15 +03:00
Do not scan device if it is part of active multipath.
Add filter which tries to check if scanned device is part of active multipath. Firstly, only SCSI major number devices are handled in filter. Then it checks if device has exactly one holder (in sysfs) and if it is device-mapper device and DM-UUID is prefixed by "MPATH-". If so, this device is filtered out. The whole filter can be switched off by setting mpath_component_detection in lvm.conf. https://bugzilla.redhat.com/show_bug.cgi?id=597010 Signed-off-by: Milan Broz <mbroz@redhat.com>
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "filter.h"
|
||||
#include "filter-composite.h"
|
||||
#include "filter-md.h"
|
||||
#include "filter-mpath.h"
|
||||
#include "filter-persistent.h"
|
||||
#include "filter-regex.h"
|
||||
#include "filter-sysfs.h"
|
||||
@@ -714,7 +715,7 @@ static int _init_dev_cache(struct cmd_context *cmd)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define MAX_FILTERS 4
|
||||
#define MAX_FILTERS 5
|
||||
|
||||
static struct dev_filter *_init_filter_components(struct cmd_context *cmd)
|
||||
{
|
||||
@@ -766,6 +767,13 @@ static struct dev_filter *_init_filter_components(struct cmd_context *cmd)
|
||||
nr_filt++;
|
||||
}
|
||||
|
||||
/* mpath component filter. Optional, non-critical. */
|
||||
if (find_config_tree_bool(cmd, "devices/multipath_component_detection",
|
||||
DEFAULT_MULTIPATH_COMPONENT_DETECTION)) {
|
||||
if ((filters[nr_filt] = mpath_filter_create(cmd->sysfs_dir)))
|
||||
nr_filt++;
|
||||
}
|
||||
|
||||
/* Only build a composite filter if we really need it. */
|
||||
return (nr_filt == 1) ?
|
||||
filters[0] : composite_filter_create(nr_filt, filters);
|
||||
|
Reference in New Issue
Block a user