1
0
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:
Milan Broz
2011-11-11 15:11:08 +00:00
parent 7891cead11
commit 07113beea3
10 changed files with 73 additions and 9 deletions

View File

@@ -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);