* [PATCH V3 02/18] multipath: remove default options from built-in
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 03/18] multipath: change default path_selector to Benjamin Marzinski
` (16 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
Since changing the path_selector, rr_min_io and rr_min_io_rq options
won't actually break the device configs, there's no reason to set
them equal to the defaults values. They can just inherit them from
the defaults section.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/hwtable.c | 171 -------------------------------------------------
1 file changed, 171 deletions(-)
diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index 668ccec..595edba 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -28,13 +28,10 @@ static struct hwentry default_hw[] = {
.product = "Compellent Vol",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_QUEUE,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -50,13 +47,10 @@ static struct hwentry default_hw[] = {
.product = "Xserve RAID ",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = DEFAULT_CHECKER,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -72,13 +66,10 @@ static struct hwentry default_hw[] = {
.product = "VV",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = DEFAULT_CHECKER,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -88,13 +79,10 @@ static struct hwentry default_hw[] = {
.product = "HSG80",
.features = "1 queue_if_no_path",
.hwhandler = "1 hp_sw",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = HP_SW,
.prio_name = PRIO_HP_SW,
.prio_args = NULL,
@@ -104,13 +92,10 @@ static struct hwentry default_hw[] = {
.product = "A6189A",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 12,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = DIRECTIO,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -121,7 +106,6 @@ static struct hwentry default_hw[] = {
.product = "(MSA|HSV)1.0.*",
.features = "1 queue_if_no_path",
.hwhandler = "1 hp_sw",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
@@ -137,7 +121,6 @@ static struct hwentry default_hw[] = {
.product = "MSA VOLUME",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
@@ -153,7 +136,6 @@ static struct hwentry default_hw[] = {
.product = "HSV1[01]1|HSV2[01]0|HSV300|HSV4[05]0",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
@@ -169,7 +151,6 @@ static struct hwentry default_hw[] = {
.product = "MSA2[02]12fc|MSA2012i",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
@@ -185,7 +166,6 @@ static struct hwentry default_hw[] = {
.product = "MSA2012sa|MSA23(12|24)(fc|i|sa)|MSA2000s VOLUME",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
@@ -202,7 +182,6 @@ static struct hwentry default_hw[] = {
.product = "HSVX700",
.features = DEFAULT_FEATURES,
.hwhandler = "1 alua",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
@@ -219,13 +198,10 @@ static struct hwentry default_hw[] = {
.product = "LOGICAL VOLUME.*",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 12,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -236,13 +212,11 @@ static struct hwentry default_hw[] = {
.product = "P2000 G3 FC|P2000G3 FC/iSCSI|P2000 G3 SAS|P2000 G3 iSCSI",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 18,
.minio = 100,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = PRIO_ALUA,
.prio_args = NULL,
@@ -258,13 +232,10 @@ static struct hwentry default_hw[] = {
.product = "SAN DataDirector",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = DIRECTIO,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -280,13 +251,10 @@ static struct hwentry default_hw[] = {
.product = "SYMMETRIX",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 6,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -297,13 +265,10 @@ static struct hwentry default_hw[] = {
.bl_product = "LUNZ",
.features = "1 queue_if_no_path",
.hwhandler = "1 emc",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = (300 / DEFAULT_CHECKINT),
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = EMC_CLARIION,
.prio_name = PRIO_EMC,
.prio_args = NULL,
@@ -314,13 +279,10 @@ static struct hwentry default_hw[] = {
.bl_product = "LUNZ",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 5,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -336,13 +298,10 @@ static struct hwentry default_hw[] = {
.product = "CentricStor",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_SERIAL,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = DIRECTIO,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -352,12 +311,10 @@ static struct hwentry default_hw[] = {
.product = "ETERNUS_DX(L|400|8000)",
.features = "1 queue_if_no_path",
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 10,
- .minio = DEFAULT_MINIO,
.checker_name = TUR,
.prio_name = PRIO_ALUA,
.prio_args = NULL,
@@ -373,13 +330,10 @@ static struct hwentry default_hw[] = {
.product = "OPEN-.*",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -389,13 +343,10 @@ static struct hwentry default_hw[] = {
.product = "DF.*",
.features = "1 queue_if_no_path",
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = PRIO_HDS,
.prio_args = NULL,
@@ -411,13 +362,10 @@ static struct hwentry default_hw[] = {
.product = "ProFibre 4000R",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = DIRECTIO,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -429,13 +377,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = "1 queue_if_no_path",
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 300,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -447,13 +392,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = "1 queue_if_no_path",
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 300,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -465,13 +407,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = "1 queue_if_no_path",
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 300,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -483,13 +422,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = DEFAULT_FEATURES,
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_QUEUE,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -500,13 +436,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = "2 pg_init_retries 50",
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 15,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -518,13 +451,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = DEFAULT_FEATURES,
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_QUEUE,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -536,13 +466,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = DEFAULT_FEATURES,
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_QUEUE,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -554,13 +481,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = DEFAULT_FEATURES,
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_QUEUE,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -572,13 +496,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = DEFAULT_FEATURES,
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_QUEUE,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -589,13 +510,10 @@ static struct hwentry default_hw[] = {
.product = "^3542",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_SERIAL,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -606,13 +524,10 @@ static struct hwentry default_hw[] = {
.product = "^2105800",
.features = "1 queue_if_no_path",
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_SERIAL,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -623,13 +538,10 @@ static struct hwentry default_hw[] = {
.product = "^2105F20",
.features = "1 queue_if_no_path",
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_SERIAL,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -640,13 +552,10 @@ static struct hwentry default_hw[] = {
.product = "^1750500",
.features = "1 queue_if_no_path",
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = PRIO_ALUA,
.prio_args = NULL,
@@ -657,13 +566,10 @@ static struct hwentry default_hw[] = {
.product = "^2107900",
.features = "1 queue_if_no_path",
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -674,13 +580,10 @@ static struct hwentry default_hw[] = {
.product = "^2145",
.features = "1 queue_if_no_path",
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = PRIO_ALUA,
.prio_args = NULL,
@@ -693,13 +596,10 @@ static struct hwentry default_hw[] = {
.uid_attribute = "ID_UID",
.features = "1 queue_if_no_path",
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = DIRECTIO,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -712,13 +612,10 @@ static struct hwentry default_hw[] = {
.uid_attribute = "ID_UID",
.features = "1 queue_if_no_path",
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = DIRECTIO,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -729,13 +626,10 @@ static struct hwentry default_hw[] = {
.product = "^IPR.*",
.features = "1 queue_if_no_path",
.hwhandler = "1 alua",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = PRIO_ALUA,
.prio_args = NULL,
@@ -746,13 +640,11 @@ static struct hwentry default_hw[] = {
.product = "1820N00",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_QUEUE,
.minio = 100,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = PRIO_ALUA,
.prio_args = NULL,
@@ -763,13 +655,11 @@ static struct hwentry default_hw[] = {
.product = "2810XIV",
.features = "1 queue_if_no_path",
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = 15,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
.minio = 15,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -786,13 +676,10 @@ static struct hwentry default_hw[] = {
.product = "VDASD",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = (300 / DEFAULT_CHECKINT),
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = DIRECTIO,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -803,13 +690,10 @@ static struct hwentry default_hw[] = {
.product = "3303 NVDISK",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = FAILOVER,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = (300 / DEFAULT_CHECKINT),
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -820,13 +704,10 @@ static struct hwentry default_hw[] = {
.product = "NVDISK",
.features = DEFAULT_FEATURES,
.hwhandler = "1 alua",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = (300 / DEFAULT_CHECKINT),
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = PRIO_ALUA,
.prio_args = NULL,
@@ -838,13 +719,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = "2 pg_init_retries 50",
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 15,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -856,13 +734,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = "2 pg_init_retries 50",
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 15,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -874,13 +749,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = "2 pg_init_retries 50",
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 15,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -892,13 +764,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = "2 pg_init_retries 50",
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 15,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -914,7 +783,6 @@ static struct hwentry default_hw[] = {
.product = "LUN.*",
.features = "3 queue_if_no_path pg_init_retries 50",
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.flush_on_last_del = FLUSH_ENABLED,
@@ -936,7 +804,6 @@ static struct hwentry default_hw[] = {
.product = "COMSTAR",
.features = "1 queue_if_no_path",
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_SERIAL,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
@@ -957,7 +824,6 @@ static struct hwentry default_hw[] = {
.product = "Nseries.*",
.features = "1 queue_if_no_path",
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
@@ -978,13 +844,10 @@ static struct hwentry default_hw[] = {
.product = "Axiom.*",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = PRIO_ALUA,
.prio_args = NULL,
@@ -1001,13 +864,10 @@ static struct hwentry default_hw[] = {
.product = "TP9[13]00",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = DIRECTIO,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -1018,13 +878,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = DEFAULT_FEATURES,
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_QUEUE,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -1035,13 +892,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = "2 pg_init_retries 50",
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 15,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -1052,13 +906,10 @@ static struct hwentry default_hw[] = {
.product = "DISK ARRAY",
.features = DEFAULT_FEATURES,
.hwhandler = "1 alua",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = PRIO_ALUA,
.prio_args = NULL,
@@ -1075,13 +926,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = DEFAULT_FEATURES,
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = TUR,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -1097,13 +945,10 @@ static struct hwentry default_hw[] = {
.product = "(StorEdge 3510|T4)",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = DIRECTIO,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -1113,13 +958,10 @@ static struct hwentry default_hw[] = {
.product = "FC2502",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = DEFAULT_CHECKER,
.prio_name = DEFAULT_PRIO,
.prio_args = NULL,
@@ -1135,7 +977,6 @@ static struct hwentry default_hw[] = {
.product = "RAIGE VOLUME",
.features = "1 queue_if_no_path",
.hwhandler = DEFAULT_HWHANDLER,
- .selector = DEFAULT_SELECTOR,
.pgpolicy = MULTIBUS,
.pgfailback = FAILBACK_UNDEF,
.rr_weight = RR_WEIGHT_NONE,
@@ -1151,13 +992,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = DEFAULT_FEATURES,
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_QUEUE,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -1169,13 +1007,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = DEFAULT_FEATURES,
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_QUEUE,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -1187,13 +1022,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = "2 pg_init_retries 50",
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = 15,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
@@ -1204,13 +1036,10 @@ static struct hwentry default_hw[] = {
.bl_product = "Universal Xport",
.features = DEFAULT_FEATURES,
.hwhandler = "1 rdac",
- .selector = DEFAULT_SELECTOR,
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_QUEUE,
- .minio = DEFAULT_MINIO,
- .minio_rq = DEFAULT_MINIO_RQ,
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
.prio_args = NULL,
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH V3 03/18] multipath: change default path_selector to
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 02/18] multipath: remove default options from built-in Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 04/18] multipath: make devt2devname use lstat to check Benjamin Marzinski
` (15 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
My testing has showed service-time to be as good and occassionally
noticeably better than round-robin. So the patch switches the
default selector to give better performance out of the box.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/defaults.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
index f647ee0..097c66f 100644
--- a/libmultipath/defaults.h
+++ b/libmultipath/defaults.h
@@ -1,7 +1,7 @@
#define DEFAULT_UID_ATTRIBUTE "ID_SERIAL"
#define DEFAULT_UDEVDIR "/dev"
#define DEFAULT_MULTIPATHDIR "/" LIB_STRING "/multipath"
-#define DEFAULT_SELECTOR "round-robin 0"
+#define DEFAULT_SELECTOR "service-time 0"
#define DEFAULT_ALIAS_PREFIX "mpath"
#define DEFAULT_FEATURES "0"
#define DEFAULT_HWHANDLER "0"
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH V3 04/18] multipath: make devt2devname use lstat to check
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 02/18] multipath: remove default options from built-in Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 03/18] multipath: change default path_selector to Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 05/18] multipath: add support for Benjamin Marzinski
` (14 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
dm_reassign wasn't working correctly for me because devt2devname used stat()
to check if /sys/dev/block/major:minor was a symlink. But stat() never returns
a symlink, if follows it. It needs to use lstat() instead. Also, I made
multipath log a message when a dm device gets reassigned to use multipath.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/devmapper.c | 4 +++-
libmultipath/sysfs.c | 6 ++++--
libmultipath/util.c | 3 ++-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
index a6e7150..89615b0 100644
--- a/libmultipath/devmapper.c
+++ b/libmultipath/devmapper.c
@@ -1394,8 +1394,10 @@ int dm_reassign(const char *mapname)
return 1;
}
- if (!(dmt = dm_task_create(DM_DEVICE_DEPS)))
+ if (!(dmt = dm_task_create(DM_DEVICE_DEPS))) {
+ condlog(3, "%s: couldn't make dm task", mapname);
return 0;
+ }
if (!dm_task_set_name(dmt, mapname))
goto out;
diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c
index 9c554dd..d33747f 100644
--- a/libmultipath/sysfs.c
+++ b/libmultipath/sysfs.c
@@ -125,8 +125,10 @@ int sysfs_check_holders(char * check_devt, char * new_devt)
return 0;
}
- if (devt2devname(check_dev, PATH_SIZE, check_devt))
+ if (devt2devname(check_dev, PATH_SIZE, check_devt)) {
+ condlog(1, "can't get devname for %s", check_devt);
return 0;
+ }
condlog(3, "%s: checking holder", check_dev);
@@ -153,7 +155,7 @@ int sysfs_check_holders(char * check_devt, char * new_devt)
}
table_name = dm_mapname(major, table_minor);
- condlog(3, "%s: reassign table %s old %s new %s", check_dev,
+ condlog(0, "%s: reassign table %s old %s new %s", check_dev,
table_name, check_devt, new_devt);
dm_reassign_table(table_name, check_devt, new_devt);
diff --git a/libmultipath/util.c b/libmultipath/util.c
index 7cdfd28..3ac018c 100644
--- a/libmultipath/util.c
+++ b/libmultipath/util.c
@@ -161,6 +161,7 @@ devt2devname (char *devname, int devname_len, char *devt)
struct stat statbuf;
memset(block_path, 0, sizeof(block_path));
+ memset(dev, 0, sizeof(dev));
if (sscanf(devt, "%u:%u", &major, &minor) != 2) {
condlog(0, "Invalid device number %s", devt);
return 1;
@@ -172,7 +173,7 @@ devt2devname (char *devname, int devname_len, char *devt)
if (stat("/sys/dev/block", &statbuf) == 0) {
/* Newer kernels have /sys/dev/block */
sprintf(block_path,"/sys/dev/block/%u:%u", major, minor);
- if (stat(block_path, &statbuf) == 0) {
+ if (lstat(block_path, &statbuf) == 0) {
if (S_ISLNK(statbuf.st_mode) &&
readlink(block_path, dev, FILE_NAME_SIZE) > 0) {
char *p = strrchr(dev, '/');
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH V3 05/18] multipath: add support for
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
` (2 preceding siblings ...)
2013-01-12 6:04 ` [PATCH V3 04/18] multipath: make devt2devname use lstat to check Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 06/18] multipath: remove duplicates from multipath Benjamin Marzinski
` (13 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
This adds support for the retain_attached_hw_handler. When this is set to
"yes", if the kernel has already attached a hardware handler to the multipath
path devices, multipath will use that one, instead of its configured one. If
no hardware handler is already attached, multipath use its configured one, if
any. To properly ignore this on older kernels, I had to makes some changes
to the version checking code.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/config.c | 5 +++-
libmultipath/config.h | 4 ++-
libmultipath/configure.c | 7 +++--
libmultipath/defaults.h | 1 +
libmultipath/devmapper.c | 34 ++++------------------
libmultipath/devmapper.h | 8 +++++-
libmultipath/dict.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++
libmultipath/dmparser.c | 3 ++
libmultipath/propsel.c | 29 ++++++++++++++++++-
libmultipath/propsel.h | 1 +
libmultipath/structs.h | 7 +++++
11 files changed, 138 insertions(+), 35 deletions(-)
diff --git a/libmultipath/config.c b/libmultipath/config.c
index 51b4f45..5b26298 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -326,6 +326,7 @@ merge_hwe (struct hwentry * dst, struct hwentry * src)
merge_num(fast_io_fail);
merge_num(dev_loss);
merge_num(user_friendly_names);
+ merge_num(retain_hwhandler);
return 0;
}
@@ -385,6 +386,7 @@ store_hwe (vector hwtable, struct hwentry * dhwe)
hwe->fast_io_fail = dhwe->fast_io_fail;
hwe->dev_loss = dhwe->dev_loss;
hwe->user_friendly_names = dhwe->user_friendly_names;
+ hwe->retain_hwhandler = dhwe->retain_hwhandler;
if (dhwe->bl_product && !(hwe->bl_product = set_param_str(dhwe->bl_product)))
goto out;
@@ -501,7 +503,7 @@ load_config (char * file)
conf->verbosity = DEFAULT_VERBOSITY;
conf->udev = udev_new();
- conf->dmrq = dm_drv_get_rq();
+ dm_drv_version(conf->version, TGT_MPATH);
conf->dev_type = DEV_NONE;
conf->minio = DEFAULT_MINIO;
conf->minio_rq = DEFAULT_MINIO_RQ;
@@ -517,6 +519,7 @@ load_config (char * file)
conf->checkint = DEFAULT_CHECKINT;
conf->max_checkint = MAX_CHECKINT(conf->checkint);
conf->fast_io_fail = DEFAULT_FAST_IO_FAIL;
+ conf->retain_hwhandler = DEFAULT_RETAIN_HWHANDLER;
/*
* preload default hwtable
diff --git a/libmultipath/config.h b/libmultipath/config.h
index 51fc492..7a1409f 100644
--- a/libmultipath/config.h
+++ b/libmultipath/config.h
@@ -46,6 +46,7 @@ struct hwentry {
int fast_io_fail;
unsigned int dev_loss;
int user_friendly_names;
+ int retain_hwhandler;
char * bl_product;
};
@@ -75,7 +76,6 @@ struct mpentry {
};
struct config {
- int dmrq;
int verbosity;
int dry_run;
int list;
@@ -109,6 +109,8 @@ struct config {
mode_t mode;
uint32_t cookie;
int reassign_maps;
+ int retain_hwhandler;
+ unsigned int version[3];
char * dev;
struct udev * udev;
diff --git a/libmultipath/configure.c b/libmultipath/configure.c
index 0f1fe43..131b5ad 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -76,6 +76,7 @@ setup_map (struct multipath * mpp, char * params, int params_size)
select_fast_io_fail(mpp);
select_dev_loss(mpp);
select_reservation_key(mpp);
+ select_retain_hwhandler(mpp);
sysfs_set_scsi_tmo(mpp);
/*
@@ -217,8 +218,10 @@ select_action (struct multipath * mpp, vector curmp, int force_reload)
mpp->alias);
return;
}
- if (!cmpp->selector || strncmp(cmpp->hwhandler, mpp->hwhandler,
- strlen(mpp->hwhandler))) {
+ if (mpp->retain_hwhandler != RETAIN_HWHANDLER_ON &&
+ (strlen(cmpp->hwhandler) != strlen(mpp->hwhandler) ||
+ strncmp(cmpp->hwhandler, mpp->hwhandler,
+ strlen(mpp->hwhandler)))) {
mpp->action = ACT_RELOAD;
condlog(3, "%s: set ACT_RELOAD (hwhandler change)",
mpp->alias);
diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
index 097c66f..f8a8774 100644
--- a/libmultipath/defaults.h
+++ b/libmultipath/defaults.h
@@ -16,6 +16,7 @@
#define DEFAULT_VERBOSITY 2
#define DEFAULT_REASSIGN_MAPS 1
#define DEFAULT_FAST_IO_FAIL 5
+#define DEFAULT_RETAIN_HWHANDLER RETAIN_HWHANDLER_OFF
#define DEFAULT_CHECKINT 5
#define MAX_CHECKINT(a) (a << 2)
diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
index 89615b0..f474e97 100644
--- a/libmultipath/devmapper.c
+++ b/libmultipath/devmapper.c
@@ -98,12 +98,6 @@ dm_init(void) {
dm_log_init_verbose(conf ? conf->verbosity + 3 : 0);
}
-#define VERSION_GE(v, minv) ( \
- (v[0] > minv[0]) || \
- ((v[0] == minv[0]) && (v[1] > minv[1])) || \
- ((v[0] == minv[0]) && (v[1] == minv[1]) && (v[2] >= minv[2])) \
-)
-
static int
dm_lib_prereq (void)
{
@@ -126,7 +120,7 @@ dm_lib_prereq (void)
return 1;
}
-static int
+int
dm_drv_version (unsigned int * version, char * str)
{
int r = 2;
@@ -135,6 +129,10 @@ dm_drv_version (unsigned int * version, char * str)
struct dm_versions *last_target;
unsigned int *v;
+ version[0] = 0;
+ version[1] = 0;
+ version[2] = 0;
+
if (!(dmt = dm_task_create(DM_DEVICE_LIST_VERSIONS)))
return 1;
@@ -169,28 +167,6 @@ out:
return r;
}
-int
-dm_drv_get_rq (void)
-{
- unsigned int minv_dmrq[3] = {1, 1, 0};
- unsigned int version[3] = {0, 0, 0};
- unsigned int * v = version;
-
- if (dm_drv_version(v, TGT_MPATH)) {
- /* in doubt return least capable */
- return 0;
- }
-
- /* test request based multipath capability */
- if VERSION_GE(v, minv_dmrq) {
- condlog(3, "activate request-based multipathing mode "
- "(driver >= v%u.%u.%u)",
- minv_dmrq[0], minv_dmrq[1], minv_dmrq[2]);
- return 1;
- }
- return 0;
-}
-
static int
dm_drv_prereq (void)
{
diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h
index b08aa31..bf8ee91 100644
--- a/libmultipath/devmapper.h
+++ b/libmultipath/devmapper.h
@@ -8,7 +8,7 @@
void dm_init(void);
int dm_prereq (void);
-int dm_drv_get_rq (void);
+int dm_drv_version (unsigned int * version, char * str);
int dm_simplecmd_flush (int, const char *, int);
int dm_simplecmd_noflush (int, const char *);
int dm_addmap_create (struct multipath *mpp, char *params);
@@ -47,4 +47,10 @@ int dm_setgeometry(struct multipath *mpp);
void udev_wait(unsigned int c);
void udev_set_sync_support(int c);
+#define VERSION_GE(v, minv) ( \
+ (v[0] > minv[0]) || \
+ ((v[0] == minv[0]) && (v[1] > minv[1])) || \
+ ((v[0] == minv[0]) && (v[1] == minv[1]) && (v[2] >= minv[2])) \
+)
+
#endif /* _DEVMAPPER_H */
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index 6dae335..88b4aba 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -629,6 +629,29 @@ wwids_file_handler(vector strvec)
return 0;
}
+static int
+def_retain_hwhandler_handler(vector strvec)
+{
+ char * buff;
+
+ buff = set_value(strvec);
+
+ if (!buff)
+ return 1;
+
+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) ||
+ (strlen(buff) == 1 && !strcmp(buff, "0")))
+ conf->retain_hwhandler = RETAIN_HWHANDLER_OFF;
+ else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) ||
+ (strlen(buff) == 1 && !strcmp(buff, "1")))
+ conf->retain_hwhandler = RETAIN_HWHANDLER_ON;
+ else
+ conf->retain_hwhandler = RETAIN_HWHANDLER_UNDEF;
+
+ FREE(buff);
+ return 0;
+}
+
/*
* blacklist block handlers
*/
@@ -1250,6 +1273,33 @@ hw_names_handler(vector strvec)
return 0;
}
+static int
+hw_retain_hwhandler_handler(vector strvec)
+{
+ struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable);
+ char * buff;
+
+ if (!hwe)
+ return 1;
+
+ buff = set_value(strvec);
+
+ if (!buff)
+ return 1;
+
+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) ||
+ (strlen(buff) == 1 && !strcmp(buff, "0")))
+ hwe->retain_hwhandler = RETAIN_HWHANDLER_OFF;
+ else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) ||
+ (strlen(buff) == 1 && !strcmp(buff, "1")))
+ hwe->retain_hwhandler = RETAIN_HWHANDLER_ON;
+ else
+ hwe->user_friendly_names = RETAIN_HWHANDLER_UNDEF;
+
+ FREE(buff);
+ return 0;
+}
+
/*
* multipaths block handlers
*/
@@ -2274,6 +2324,19 @@ snprint_hw_user_friendly_names (char * buff, int len, void * data)
}
static int
+snprint_hw_retain_hwhandler_handler(char * buff, int len, void * data)
+{
+ struct hwentry * hwe = (struct hwentry *)data;
+
+ if (hwe->retain_hwhandler == RETAIN_HWHANDLER_ON)
+ return snprintf(buff, len, "yes");
+ else if (hwe->retain_hwhandler == RETAIN_HWHANDLER_OFF)
+ return snprintf(buff, len, "no");
+ else
+ return 0;
+}
+
+static int
snprint_def_polling_interval (char * buff, int len, void * data)
{
return snprintf(buff, len, "%i", conf->checkint);
@@ -2599,6 +2662,15 @@ snprint_def_reservation_key(char * buff, int len, void * data)
}
static int
+snprint_def_retain_hwhandler_handler(char * buff, int len, void * data)
+{
+ if (conf->retain_hwhandler == RETAIN_HWHANDLER_ON)
+ return snprintf(buff, len, "yes");
+ else
+ return snprintf(buff, len, "no");
+}
+
+static int
snprint_ble_simple (char * buff, int len, void * data)
{
struct blentry * ble = (struct blentry *)data;
@@ -2662,6 +2734,7 @@ init_keywords(void)
install_keyword("wwids_file", &wwids_file_handler, &snprint_def_wwids_file);
install_keyword("log_checker_err", &def_log_checker_err_handler, &snprint_def_log_checker_err);
install_keyword("reservation_key", &def_reservation_key_handler, &snprint_def_reservation_key);
+ install_keyword("retain_attached_hw_handler", &def_retain_hwhandler_handler, &snprint_def_retain_hwhandler_handler);
__deprecated install_keyword("default_selector", &def_selector_handler, NULL);
__deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL);
__deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL);
@@ -2723,6 +2796,7 @@ init_keywords(void)
install_keyword("fast_io_fail_tmo", &hw_fast_io_fail_handler, &snprint_hw_fast_io_fail);
install_keyword("dev_loss_tmo", &hw_dev_loss_handler, &snprint_hw_dev_loss);
install_keyword("user_friendly_names", &hw_names_handler, &snprint_hw_user_friendly_names);
+ install_keyword("retain_attached_hw_handler", &hw_retain_hwhandler_handler, &snprint_hw_retain_hwhandler_handler);
install_sublevel_end();
install_keyword_root("multipaths", &multipaths_handler);
diff --git a/libmultipath/dmparser.c b/libmultipath/dmparser.c
index 5184c41..2562ba1 100644
--- a/libmultipath/dmparser.c
+++ b/libmultipath/dmparser.c
@@ -56,6 +56,7 @@ assemble_map (struct multipath * mp, char * params, int len)
int nr_priority_groups, initial_pg_nr;
char * p, * f;
char no_path_retry[] = "queue_if_no_path";
+ char retain_hwhandler[] = "retain_attached_hw_handler";
struct pathgroup * pgp;
struct path * pp;
@@ -81,6 +82,8 @@ assemble_map (struct multipath * mp, char * params, int len)
} else {
add_feature(&f, no_path_retry);
}
+ if (mp->retain_hwhandler == RETAIN_HWHANDLER_ON)
+ add_feature(&f, retain_hwhandler);
shift = snprintf(p, freechar, "%s %s %i %i",
f, mp->hwhandler,
diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
index b8c6b08..c03926a 100644
--- a/libmultipath/propsel.c
+++ b/libmultipath/propsel.c
@@ -513,7 +513,9 @@ select_minio_bio (struct multipath * mp)
extern int
select_minio (struct multipath * mp)
{
- if (conf->dmrq)
+ unsigned int minv_dmrq[3] = {1, 1, 0};
+
+ if (VERSION_GE(conf->version, minv_dmrq))
return select_minio_rq(mp);
else
return select_minio_bio(mp);
@@ -679,3 +681,28 @@ select_reservation_key (struct multipath * mp)
return 0;
}
+extern int
+select_retain_hwhandler (struct multipath * mp)
+{
+ unsigned int minv_dm_retain[3] = {1, 5, 0};
+
+ if (!VERSION_GE(conf->version, minv_dm_retain)) {
+ mp->retain_hwhandler = RETAIN_HWHANDLER_OFF;
+ condlog(3, "%s: retain_attached_hw_hander disabled (requires kernel version >= 1.5.0)", mp->alias);
+ return 0;
+ }
+
+ if (mp->hwe && mp->hwe->retain_hwhandler) {
+ mp->retain_hwhandler = mp->hwe->retain_hwhandler;
+ condlog(3, "%s: retain_attached_hw_handler = %d (controller default)", mp->alias, mp->retain_hwhandler);
+ return 0;
+ }
+ if (conf->retain_hwhandler) {
+ mp->retain_hwhandler = conf->retain_hwhandler;
+ condlog(3, "%s: retain_attached_hw_handler = %d (config file default)", mp->alias, mp->retain_hwhandler);
+ return 0;
+ }
+ mp->retain_hwhandler = 0;
+ condlog(3, "%s: retain_attached_hw_handler = %d (compiled in default)", mp->alias, mp->retain_hwhandler);
+ return 0;
+}
diff --git a/libmultipath/propsel.h b/libmultipath/propsel.h
index 4e931d4..1bf6e45 100644
--- a/libmultipath/propsel.h
+++ b/libmultipath/propsel.h
@@ -18,3 +18,4 @@ int select_gid(struct multipath *mp);
int select_fast_io_fail(struct multipath *mp);
int select_dev_loss(struct multipath *mp);
int select_reservation_key(struct multipath *mp);
+int select_retain_hwhandler (struct multipath * mp);
diff --git a/libmultipath/structs.h b/libmultipath/structs.h
index 16e940b..92cd2e4 100644
--- a/libmultipath/structs.h
+++ b/libmultipath/structs.h
@@ -101,6 +101,12 @@ enum user_friendly_names_states {
USER_FRIENDLY_NAMES_ON,
};
+enum retain_hwhandler_states {
+ RETAIN_HWHANDLER_UNDEF,
+ RETAIN_HWHANDLER_OFF,
+ RETAIN_HWHANDLER_ON,
+};
+
struct scsi_idlun {
int dev_id;
int host_unique_id;
@@ -192,6 +198,7 @@ struct multipath {
int flush_on_last_del;
int attribute_flags;
int fast_io_fail;
+ int retain_hwhandler;
unsigned int dev_loss;
uid_t uid;
gid_t gid;
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH V3 06/18] multipath: remove duplicates from multipath
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
` (3 preceding siblings ...)
2013-01-12 6:04 ` [PATCH V3 05/18] multipath: add support for Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 07/18] multipath: add detect_prio option to autodetect Benjamin Marzinski
` (12 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
Added code to remove duplcate entries in the devices section, and the
blacklist devices section of the builtin configuration table. The only
change to setup_default_blist is the addition of _blacklist_device()
to check if the device's bl_product entry already exists.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/blacklist.c | 91 +++++++++++++++++++++++++-----------------------
libmultipath/config.c | 19 ++++++++--
2 files changed, 63 insertions(+), 47 deletions(-)
diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c
index f369517..49a40f9 100644
--- a/libmultipath/blacklist.c
+++ b/libmultipath/blacklist.c
@@ -96,50 +96,6 @@ set_ble_device (vector blist, char * vendor, char * product, int origin)
}
int
-setup_default_blist (struct config * conf)
-{
- struct blentry * ble;
- struct hwentry *hwe;
- char * str;
- int i;
-
- str = STRDUP("^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*");
- if (!str)
- return 1;
- if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT))
- return 1;
-
- str = STRDUP("^hd[a-z]");
- if (!str)
- return 1;
- if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT))
- return 1;
-
- str = STRDUP("^dcssblk[0-9]*");
- if (!str)
- return 1;
- if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT))
- return 1;
-
- vector_foreach_slot (conf->hwtable, hwe, i) {
- if (hwe->bl_product) {
- if (alloc_ble_device(conf->blist_device))
- return 1;
- ble = VECTOR_SLOT(conf->blist_device,
- VECTOR_SIZE(conf->blist_device) -1);
- if (set_ble_device(conf->blist_device,
- STRDUP(hwe->vendor),
- STRDUP(hwe->bl_product),
- ORIGIN_DEFAULT)) {
- FREE(ble);
- return 1;
- }
- }
- }
- return 0;
-}
-
-int
_blacklist_exceptions (vector elist, char * str)
{
int i;
@@ -193,6 +149,53 @@ _blacklist_device (vector blist, char * vendor, char * product)
return 0;
}
+int
+setup_default_blist (struct config * conf)
+{
+ struct blentry * ble;
+ struct hwentry *hwe;
+ char * str;
+ int i;
+
+ str = STRDUP("^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*");
+ if (!str)
+ return 1;
+ if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT))
+ return 1;
+
+ str = STRDUP("^hd[a-z]");
+ if (!str)
+ return 1;
+ if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT))
+ return 1;
+
+ str = STRDUP("^dcssblk[0-9]*");
+ if (!str)
+ return 1;
+ if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT))
+ return 1;
+
+ vector_foreach_slot (conf->hwtable, hwe, i) {
+ if (hwe->bl_product) {
+ if (_blacklist_device(conf->blist_device, hwe->vendor,
+ hwe->bl_product))
+ continue;
+ if (alloc_ble_device(conf->blist_device))
+ return 1;
+ ble = VECTOR_SLOT(conf->blist_device,
+ VECTOR_SIZE(conf->blist_device) -1);
+ if (set_ble_device(conf->blist_device,
+ STRDUP(hwe->vendor),
+ STRDUP(hwe->bl_product),
+ ORIGIN_DEFAULT)) {
+ FREE(ble);
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
#define LOG_BLIST(M) \
if (vendor && product) \
condlog(3, "%s: (%s:%s) %s", dev, vendor, product, (M)); \
diff --git a/libmultipath/config.c b/libmultipath/config.c
index 5b26298..50863b2 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -25,13 +25,19 @@
static int
hwe_strmatch (struct hwentry *hwe1, struct hwentry *hwe2)
{
- if (hwe1->vendor && hwe2->vendor && strcmp(hwe1->vendor, hwe2->vendor))
+ if ((hwe2->vendor && !hwe1->vendor) ||
+ (hwe1->vendor && (!hwe2->vendor ||
+ strcmp(hwe1->vendor, hwe2->vendor))))
return 1;
- if (hwe1->product && hwe2->product && strcmp(hwe1->product, hwe2->product))
+ if ((hwe2->product && !hwe1->product) ||
+ (hwe1->product && (!hwe2->product ||
+ strcmp(hwe1->product, hwe2->product))))
return 1;
- if (hwe1->revision && hwe2->revision && strcmp(hwe1->revision, hwe2->revision))
+ if ((hwe2->revision && !hwe1->revision) ||
+ (hwe1->revision && (!hwe2->revision ||
+ strcmp(hwe1->revision, hwe2->revision))))
return 1;
return 0;
@@ -416,6 +422,13 @@ factorize_hwtable (vector hw, int n)
continue;
/* dup */
merge_hwe(hwe2, hwe1);
+ if (hwe_strmatch(hwe2, hwe1) == 0) {
+ vector_del_slot(hw, i);
+ free_hwe(hwe1);
+ n -= 1;
+ i -= 1;
+ break;
+ }
}
}
return 0;
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH V3 07/18] multipath: add detect_prio option to autodetect
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
` (4 preceding siblings ...)
2013-01-12 6:04 ` [PATCH V3 06/18] multipath: remove duplicates from multipath Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 08/18] multipath: update netapp config Benjamin Marzinski
` (11 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
This patch adds a new multipath.conf option, detect_prio. If set to yes,
multipathd will try to determine the correct prioritizer for the device. If
it finds one, that will be used instead of its configured prioritizer. If
none is found, the configured prioritizer will be used. It can currently
only detect ALUA devices.
Also fixed and issue with select_prio where in the devices section, it was
passing in the prio name string instead of the prio args string to prio_get()
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/Makefile | 2 +-
libmultipath/config.c | 3 ++
libmultipath/config.h | 2 ++
libmultipath/defaults.h | 1 +
libmultipath/dict.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++
libmultipath/discovery.c | 1 +
libmultipath/propsel.c | 39 ++++++++++++++++++++++++-
libmultipath/propsel.h | 1 +
libmultipath/structs.h | 7 +++++
9 files changed, 128 insertions(+), 2 deletions(-)
diff --git a/libmultipath/Makefile b/libmultipath/Makefile
index 0395602..22d3844 100644
--- a/libmultipath/Makefile
+++ b/libmultipath/Makefile
@@ -15,7 +15,7 @@ OBJS = memory.o parser.o vector.o devmapper.o \
pgpolicies.o debug.o regex.o defaults.o uevent.o \
switchgroup.o uxsock.o print.o alias.o log_pthread.o \
log.o configure.o structs_vec.o sysfs.o prio.o checkers.o \
- lock.o waiter.o file.o wwids.o
+ lock.o waiter.o file.o wwids.o prioritizers/alua_rtpg.o
LIBDM_API_FLUSH = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_no_flush' /usr/include/libdevmapper.h)
diff --git a/libmultipath/config.c b/libmultipath/config.c
index 50863b2..b317e32 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -333,6 +333,7 @@ merge_hwe (struct hwentry * dst, struct hwentry * src)
merge_num(dev_loss);
merge_num(user_friendly_names);
merge_num(retain_hwhandler);
+ merge_num(detect_prio);
return 0;
}
@@ -393,6 +394,7 @@ store_hwe (vector hwtable, struct hwentry * dhwe)
hwe->dev_loss = dhwe->dev_loss;
hwe->user_friendly_names = dhwe->user_friendly_names;
hwe->retain_hwhandler = dhwe->retain_hwhandler;
+ hwe->detect_prio = dhwe->detect_prio;
if (dhwe->bl_product && !(hwe->bl_product = set_param_str(dhwe->bl_product)))
goto out;
@@ -533,6 +535,7 @@ load_config (char * file)
conf->max_checkint = MAX_CHECKINT(conf->checkint);
conf->fast_io_fail = DEFAULT_FAST_IO_FAIL;
conf->retain_hwhandler = DEFAULT_RETAIN_HWHANDLER;
+ conf->detect_prio = DEFAULT_DETECT_PRIO;
/*
* preload default hwtable
diff --git a/libmultipath/config.h b/libmultipath/config.h
index 7a1409f..4ade355 100644
--- a/libmultipath/config.h
+++ b/libmultipath/config.h
@@ -47,6 +47,7 @@ struct hwentry {
unsigned int dev_loss;
int user_friendly_names;
int retain_hwhandler;
+ int detect_prio;
char * bl_product;
};
@@ -110,6 +111,7 @@ struct config {
uint32_t cookie;
int reassign_maps;
int retain_hwhandler;
+ int detect_prio;
unsigned int version[3];
char * dev;
diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
index f8a8774..32948d8 100644
--- a/libmultipath/defaults.h
+++ b/libmultipath/defaults.h
@@ -17,6 +17,7 @@
#define DEFAULT_REASSIGN_MAPS 1
#define DEFAULT_FAST_IO_FAIL 5
#define DEFAULT_RETAIN_HWHANDLER RETAIN_HWHANDLER_OFF
+#define DEFAULT_DETECT_PRIO DETECT_PRIO_OFF
#define DEFAULT_CHECKINT 5
#define MAX_CHECKINT(a) (a << 2)
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index 88b4aba..788ffae 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -652,6 +652,29 @@ def_retain_hwhandler_handler(vector strvec)
return 0;
}
+static int
+def_detect_prio_handler(vector strvec)
+{
+ char * buff;
+
+ buff = set_value(strvec);
+
+ if (!buff)
+ return 1;
+
+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) ||
+ (strlen(buff) == 1 && !strcmp(buff, "0")))
+ conf->detect_prio = DETECT_PRIO_OFF;
+ else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) ||
+ (strlen(buff) == 1 && !strcmp(buff, "1")))
+ conf->detect_prio = DETECT_PRIO_ON;
+ else
+ conf->detect_prio = DETECT_PRIO_UNDEF;
+
+ FREE(buff);
+ return 0;
+}
+
/*
* blacklist block handlers
*/
@@ -1300,6 +1323,33 @@ hw_retain_hwhandler_handler(vector strvec)
return 0;
}
+static int
+hw_detect_prio_handler(vector strvec)
+{
+ struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable);
+ char * buff;
+
+ if (!hwe)
+ return 1;
+
+ buff = set_value(strvec);
+
+ if (!buff)
+ return 1;
+
+ if ((strlen(buff) == 2 && !strcmp(buff, "no")) ||
+ (strlen(buff) == 1 && !strcmp(buff, "0")))
+ hwe->detect_prio = DETECT_PRIO_OFF;
+ else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) ||
+ (strlen(buff) == 1 && !strcmp(buff, "1")))
+ hwe->detect_prio = DETECT_PRIO_ON;
+ else
+ hwe->detect_prio = DETECT_PRIO_UNDEF;
+
+ FREE(buff);
+ return 0;
+}
+
/*
* multipaths block handlers
*/
@@ -2337,6 +2387,19 @@ snprint_hw_retain_hwhandler_handler(char * buff, int len, void * data)
}
static int
+snprint_detect_prio(char * buff, int len, void * data)
+{
+ struct hwentry * hwe = (struct hwentry *)data;
+
+ if (hwe->detect_prio == DETECT_PRIO_ON)
+ return snprintf(buff, len, "yes");
+ else if (hwe->detect_prio == DETECT_PRIO_OFF)
+ return snprintf(buff, len, "no");
+ else
+ return 0;
+}
+
+static int
snprint_def_polling_interval (char * buff, int len, void * data)
{
return snprintf(buff, len, "%i", conf->checkint);
@@ -2671,6 +2734,15 @@ snprint_def_retain_hwhandler_handler(char * buff, int len, void * data)
}
static int
+snprint_def_detect_prio(char * buff, int len, void * data)
+{
+ if (conf->detect_prio == DETECT_PRIO_ON)
+ return snprintf(buff, len, "yes");
+ else
+ return snprintf(buff, len, "no");
+}
+
+static int
snprint_ble_simple (char * buff, int len, void * data)
{
struct blentry * ble = (struct blentry *)data;
@@ -2735,6 +2807,7 @@ init_keywords(void)
install_keyword("log_checker_err", &def_log_checker_err_handler, &snprint_def_log_checker_err);
install_keyword("reservation_key", &def_reservation_key_handler, &snprint_def_reservation_key);
install_keyword("retain_attached_hw_handler", &def_retain_hwhandler_handler, &snprint_def_retain_hwhandler_handler);
+ install_keyword("detect_prio", &def_detect_prio_handler, &snprint_def_detect_prio);
__deprecated install_keyword("default_selector", &def_selector_handler, NULL);
__deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL);
__deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL);
@@ -2797,6 +2870,7 @@ init_keywords(void)
install_keyword("dev_loss_tmo", &hw_dev_loss_handler, &snprint_hw_dev_loss);
install_keyword("user_friendly_names", &hw_names_handler, &snprint_hw_user_friendly_names);
install_keyword("retain_attached_hw_handler", &hw_retain_hwhandler_handler, &snprint_hw_retain_hwhandler_handler);
+ install_keyword("detect_prio", &hw_detect_prio_handler, &snprint_detect_prio);
install_sublevel_end();
install_keyword_root("multipaths", &multipaths_handler);
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 3ffdc62..45570dc 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -782,6 +782,7 @@ get_prio (struct path * pp)
struct prio * p = &pp->prio;
if (!prio_selected(p)) {
+ select_detect_prio(pp);
select_prio(pp);
if (!prio_selected(p)) {
condlog(3, "%s: no prio selected", pp->dev);
diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
index c03926a..a7e1fc2 100644
--- a/libmultipath/propsel.c
+++ b/libmultipath/propsel.c
@@ -17,6 +17,7 @@
#include "devmapper.h"
#include "prio.h"
#include "discovery.h"
+#include "prioritizers/alua_rtpg.h"
#include <inttypes.h>
pgpolicyfn *pgpolicies[] = {
@@ -382,12 +383,30 @@ select_getuid (struct path * pp)
return 0;
}
+void
+detect_prio(struct path * pp)
+{
+ struct prio *p = &pp->prio;
+
+ if (get_target_port_group_support(pp->fd) > 0)
+ prio_get(p, PRIO_ALUA, DEFAULT_PRIO_ARGS);
+}
+
extern int
select_prio (struct path * pp)
{
struct mpentry * mpe;
struct prio * p = &pp->prio;
+ if (pp->detect_prio == DETECT_PRIO_ON) {
+ detect_prio(pp);
+ if (prio_selected(p)) {
+ condlog(3, "%s: prio = %s (detected setting)",
+ pp->dev, prio_name(p));
+ return 0;
+ }
+ }
+
if ((mpe = find_mpe(pp->wwid))) {
if (mpe->prio_name) {
prio_get(p, mpe->prio_name, mpe->prio_args);
@@ -398,7 +417,7 @@ select_prio (struct path * pp)
}
if (pp->hwe && pp->hwe->prio_name) {
- prio_get(p, pp->hwe->prio_name, pp->hwe->prio_name);
+ prio_get(p, pp->hwe->prio_name, pp->hwe->prio_args);
condlog(3, "%s: prio = %s (controller setting)",
pp->dev, pp->hwe->prio_name);
condlog(3, "%s: prio args = %s (controller setting)",
@@ -706,3 +725,21 @@ select_retain_hwhandler (struct multipath * mp)
condlog(3, "%s: retain_attached_hw_handler = %d (compiled in default)", mp->alias, mp->retain_hwhandler);
return 0;
}
+
+extern int
+select_detect_prio (struct path * pp)
+{
+ if (pp->hwe && pp->hwe->detect_prio) {
+ pp->detect_prio = pp->hwe->detect_prio;
+ condlog(3, "%s: detect_prio = %d (controller default)", pp->dev, pp->detect_prio);
+ return 0;
+ }
+ if (conf->detect_prio) {
+ pp->detect_prio = conf->detect_prio;
+ condlog(3, "%s: detect_prio = %d (config file default)", pp->dev, pp->detect_prio);
+ return 0;
+ }
+ pp->detect_prio = 0;
+ condlog(3, "%s: detect_prio = %d (compiled in default)", pp->dev, pp->detect_prio);
+ return 0;
+}
diff --git a/libmultipath/propsel.h b/libmultipath/propsel.h
index 1bf6e45..eb1e534 100644
--- a/libmultipath/propsel.h
+++ b/libmultipath/propsel.h
@@ -19,3 +19,4 @@ int select_fast_io_fail(struct multipath *mp);
int select_dev_loss(struct multipath *mp);
int select_reservation_key(struct multipath *mp);
int select_retain_hwhandler (struct multipath * mp);
+int select_detect_prio(struct path * pp);
diff --git a/libmultipath/structs.h b/libmultipath/structs.h
index 92cd2e4..2beccb3 100644
--- a/libmultipath/structs.h
+++ b/libmultipath/structs.h
@@ -107,6 +107,12 @@ enum retain_hwhandler_states {
RETAIN_HWHANDLER_ON,
};
+enum detect_prio_states {
+ DETECT_PRIO_UNDEF,
+ DETECT_PRIO_OFF,
+ DETECT_PRIO_ON,
+};
+
struct scsi_idlun {
int dev_id;
int host_unique_id;
@@ -165,6 +171,7 @@ struct path {
int failcount;
int priority;
int pgindex;
+ int detect_prio;
char * uid_attribute;
struct prio prio;
char * prio_args;
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH V3 08/18] multipath: update netapp config
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
` (5 preceding siblings ...)
2013-01-12 6:04 ` [PATCH V3 07/18] multipath: add detect_prio option to autodetect Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 09/18] multipath: fix set_oom_adj Benjamin Marzinski
` (10 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
The netapp config now used the retain_attached_hwhandler and
detect_prio options to automatically configure correctly for both ALUA and
non-ALUA setups. They also requested that dev_loss_tmo be set to
the maximum for netapp devices.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/hwtable.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index 595edba..6a8dfe3 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -789,9 +789,12 @@ static struct hwentry default_hw[] = {
.rr_weight = RR_WEIGHT_NONE,
.no_path_retry = NO_PATH_RETRY_UNDEF,
.minio = 128,
+ .dev_loss = MAX_DEV_LOSS_TMO,
.checker_name = TUR,
.prio_name = PRIO_ONTAP,
.prio_args = NULL,
+ .retain_hwhandler = RETAIN_HWHANDLER_ON,
+ .detect_prio = DETECT_PRIO_ON,
},
/*
* NEXENTA/COMSTAR controller family
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH V3 09/18] multipath: fix set_oom_adj
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
` (6 preceding siblings ...)
2013-01-12 6:04 ` [PATCH V3 08/18] multipath: update netapp config Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 10/18] multipath: rely on udev device creation for kpartx Benjamin Marzinski
` (9 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
Fix set_oom_adj() to work correclty if OOM_ADJUST_MIN isn't
defined.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipathd/main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/multipathd/main.c b/multipathd/main.c
index 8917499..a6afebb 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1542,8 +1542,12 @@ set_oom_adj (void)
strerror(errno));
return;
}
+#ifdef OOM_ADJUST_MIN
file = "/proc/self/oom_adj";
score = OOM_ADJUST_MIN;
+#else
+ retry = 0;
+#endif
} while (retry--);
condlog(0, "couldn't adjust oom score");
}
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH V3 10/18] multipath: rely on udev device creation for kpartx
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
` (7 preceding siblings ...)
2013-01-12 6:04 ` [PATCH V3 09/18] multipath: fix set_oom_adj Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 11/18] multipath: update documentation Benjamin Marzinski
` (8 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
Since kpartx and multipathd don't wait on udev creating the device, there
was a race between libdevmapper and udev to create the device. This meant
that sometimes the /dev/mapper/ devices were devnodes, and sometimes they
were symlinks. Now, for multipathd and kpartx called without -s,
libdevmapper won't create the device nodes, so that udev will always be
responsible for it.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
kpartx/devmapper.c | 4 ++--
kpartx/devmapper.h | 2 ++
kpartx/kpartx.c | 6 +++---
libmultipath/devmapper.c | 6 +++---
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/kpartx/devmapper.c b/kpartx/devmapper.c
index 4baebd9..24a43ee 100644
--- a/kpartx/devmapper.c
+++ b/kpartx/devmapper.c
@@ -78,7 +78,7 @@ dm_simplecmd (int task, const char *name, int no_flush, uint32_t *cookie) {
if (no_flush)
dm_task_no_flush(dmt);
- if (udev_wait_flag && !dm_task_set_cookie(dmt, cookie, 0))
+ if (udev_wait_flag && !dm_task_set_cookie(dmt, cookie, (udev_sync)? 0 : DM_UDEV_DISABLE_LIBRARY_FALLBACK))
goto out;
r = dm_task_run(dmt);
@@ -128,7 +128,7 @@ dm_addmap (int task, const char *name, const char *target,
dm_task_no_open_count(dmt);
- if (task == DM_DEVICE_CREATE && !dm_task_set_cookie(dmt, cookie, 0))
+ if (task == DM_DEVICE_CREATE && !dm_task_set_cookie(dmt, cookie, (udev_sync)? 0 : DM_UDEV_DISABLE_LIBRARY_FALLBACK))
goto addout;
r = dm_task_run (dmt);
diff --git a/kpartx/devmapper.h b/kpartx/devmapper.h
index 8e350a0..0edc063 100644
--- a/kpartx/devmapper.h
+++ b/kpartx/devmapper.h
@@ -2,6 +2,8 @@
#define MINOR(dev) ((dev & 0xff) | ((dev >> 12) & 0xfff00))
#define MKDEV(ma,mi) ((mi & 0xff) | (ma << 8) | ((mi & ~0xff) << 12))
+extern int udev_sync;
+
int dm_prereq (char *, int, int, int);
int dm_simplecmd (int, const char *, int, uint32_t *);
int dm_addmap (int, const char *, const char *, const char *, uint64_t,
diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c
index f359afe..dd57294 100644
--- a/kpartx/kpartx.c
+++ b/kpartx/kpartx.c
@@ -56,6 +56,7 @@ struct pt {
} pts[MAXTYPES];
int ptct = 0;
+int udev_sync = 0;
static void
addpts(char *t, ptreader f)
@@ -205,7 +206,6 @@ main(int argc, char **argv){
int loopro = 0;
int hotplug = 0;
int loopcreated = 0;
- int sync = 0;
struct stat buf;
uint32_t cookie = 0;
@@ -267,7 +267,7 @@ main(int argc, char **argv){
what = DELETE;
break;
case 's':
- sync = 1;
+ udev_sync = 1;
break;
case 'u':
what = UPDATE;
@@ -278,7 +278,7 @@ main(int argc, char **argv){
}
#ifdef LIBDM_API_COOKIE
- if (!sync)
+ if (!udev_sync)
dm_udev_set_sync_support(0);
#endif
diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
index f474e97..67481c4 100644
--- a/libmultipath/devmapper.c
+++ b/libmultipath/devmapper.c
@@ -219,7 +219,7 @@ dm_simplecmd (int task, const char *name, int no_flush, int need_sync) {
dm_task_no_flush(dmt); /* for DM_DEVICE_SUSPEND/RESUME */
#endif
- if (udev_wait_flag && !dm_task_set_cookie(dmt, &conf->cookie, 0))
+ if (udev_wait_flag && !dm_task_set_cookie(dmt, &conf->cookie, (conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0))
goto out;
r = dm_task_run (dmt);
@@ -284,7 +284,7 @@ dm_addmap (int task, const char *target, struct multipath *mpp, char * params,
dm_task_no_open_count(dmt);
if (task == DM_DEVICE_CREATE &&
- !dm_task_set_cookie(dmt, &conf->cookie, 0))
+ !dm_task_set_cookie(dmt, &conf->cookie, (conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0))
goto freeout;
r = dm_task_run (dmt);
@@ -1268,7 +1268,7 @@ dm_rename (char * old, char * new)
dm_task_no_open_count(dmt);
- if (!dm_task_set_cookie(dmt, &conf->cookie, 0))
+ if (!dm_task_set_cookie(dmt, &conf->cookie, (conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0))
goto out;
if (!dm_task_run(dmt))
goto out;
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH V3 11/18] multipath: update documentation
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
` (8 preceding siblings ...)
2013-01-12 6:04 ` [PATCH V3 10/18] multipath: rely on udev device creation for kpartx Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 12/18] multipath: make multipathd work with new dm/lvm Benjamin Marzinski
` (7 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
Add some missing options to the documentation.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipath/main.c | 1 +
multipath/multipath.8 | 14 +++++++++++++-
multipath/multipath.conf.5 | 31 +++++++++++++++++++++++++++++++
3 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/multipath/main.c b/multipath/main.c
index 396c4b9..e526f7c 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -101,6 +101,7 @@ usage (char * progname)
" -d dry run, do not create or update devmaps\n" \
" -t dump internal hardware table\n" \
" -r force devmap reload\n" \
+ " -B treat the bindings file as read only\n" \
" -p policy failover|multibus|group_by_serial|group_by_prio\n" \
" -b fil bindings file location\n" \
" -p pol force all maps to specified path grouping policy :\n" \
diff --git a/multipath/multipath.8 b/multipath/multipath.8
index a112df7..a63a9f1 100644
--- a/multipath/multipath.8
+++ b/multipath/multipath.8
@@ -5,8 +5,10 @@ multipath \- Device mapper target autoconfig
.B multipath
.RB [\| \-v\ \c
.IR verbosity \|]
+.RB [\| \-b\ \c
+.IR bindings_file \|]
.RB [\| \-d \|]
-.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F \| \-B \|]
+.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r \|]
.RB [\| \-p\ \c
.BR failover | multibus | group_by_serial | group_by_prio | group_by_node_name \|]
.RB [\| device \|]
@@ -56,6 +58,16 @@ force devmap reload
.B \-B
treat the bindings file as read only
.TP
+.B \-b " bindings_file"
+set user_friendly_names bindings file location. The default is
+/etc/multipath/bindings
+.TP
+.B \-c
+check if a block device should be a path in a multipath device
+.TP
+.B \-q
+allow device tables with queue_if_no_path when multipathd is not running
+.TP
.BI \-p " policy"
force new maps to use the specified policy:
.RS 1.2i
diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5
index 92fb0c1..38c08f4 100644
--- a/multipath/multipath.conf.5
+++ b/multipath/multipath.conf.5
@@ -375,6 +375,31 @@ errors are logged at level 3 until the device is restored. If set to
.I always
, multipathd always logs the path checker error at logging level 2. Default is
.I always
+.TP
+.B reservation_key
+This is the service action reservation key used by mpathpersist. It must be
+set for all multipath devices using persistent reservations, and it must be
+the same as the RESERVATION KEY field of the PERSISTENT RESERVE OUT parameter
+list which contains an 8-byte value provided by the application client to the
+device server to identify the I_T nexus. It is unset by default.
+.TP
+.B retain_attached_hw_handler
+If set to
+.I yes
+and the scsi layer has already attached a hardware_handler to the device,
+multipath will not force the device to use the hardware_handler specified by
+mutipath.conf. If the scsi layer has not attached a hardware handler,
+multipath will continue to use its configured hardware handler. Default is
+.I no
+.TP
+.B detect_prio
+If set to
+.I yes
+, multipath will try to detect if the device supports ALUA. If so, the device
+will automatically use the
+.I alua
+prioritizer. If not, the prioritizer will be selected as usual. Default is
+.I no
.
.SH "blacklist section"
The
@@ -474,6 +499,8 @@ section:
.B rr_min_io_q
.TP
.B features
+.TP
+.B reservation_key
.RE
.PD
.LP
@@ -560,6 +587,10 @@ section:
.B dev_loss_tmo
.TP
.B flush_on_last_del
+.TP
+.B retain_attached_hw_handler
+.TP
+.B detect_prio
.RE
.PD
.LP
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH V3 12/18] multipath: make multipathd work with new dm/lvm
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
` (9 preceding siblings ...)
2013-01-12 6:04 ` [PATCH V3 11/18] multipath: update documentation Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 13/18] multipath: make reservation_key print out correctly Benjamin Marzinski
` (6 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
multipathd needs to get setup before lvm (lvm2-activation-early.service).
To do this, it needs to get started in sysinit.target like the other
dm services.
Signed-off-by: Peter Rajnoha <prajnoha@redhat.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipathd/multipathd.service | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/multipathd/multipathd.service b/multipathd/multipathd.service
index 38189c5..d6da067 100644
--- a/multipathd/multipathd.service
+++ b/multipathd/multipathd.service
@@ -1,7 +1,9 @@
[Unit]
Description=Device-Mapper Multipath Device Controller
-Before=iscsi.service iscsid.service
+Before=iscsi.service iscsid.service lvm2-activation-early.service
After=syslog.target
+DefaultDependencies=no
+Conflicts=shutdown.target
[Service]
Type=forking
@@ -11,4 +13,4 @@ ExecReload=/sbin/multipathd reconfigure
#ExecStop=/path/to/scrip delete-me if not necessary
[Install]
-WantedBy=multi-user.target
+WantedBy=sysinit.target
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH V3 13/18] multipath: make reservation_key print out correctly
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
` (10 preceding siblings ...)
2013-01-12 6:04 ` [PATCH V3 12/18] multipath: make multipathd work with new dm/lvm Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-21 5:50 ` Chauhan, Vijay
2013-01-12 6:04 ` [PATCH V3 14/18] multipath: storagetek 6180 config Benjamin Marzinski
` (5 subsequent siblings)
17 siblings, 1 reply; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
This patch fixes the reservation_key print functions, so they print
it out like it was in the configuration file. Also, it keeps
cli_getprstatus() from writing over random memory.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/dict.c | 31 +++++++++++++++++++++++++++++--
multipathd/cli_handlers.c | 2 +-
2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index 788ffae..a54dda9 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -2052,8 +2052,22 @@ snprint_mp_prio_args(char * buff, int len, void * data)
static int
snprint_mp_reservation_key (char * buff, int len, void * data)
{
+ int i;
+ unsigned char *keyp;
+ uint64_t prkey = 0;
struct mpentry * mpe = (struct mpentry *)data;
- return snprintf(buff, len, "%s" , mpe->reservation_key);
+
+ if (!mpe->reservation_key)
+ return 0;
+ keyp = (unsigned char *)mpe->reservation_key;
+ for (i = 0; i < 8; i++) {
+ if (i > 0)
+ prkey <<= 8;
+ prkey |= *keyp;
+ keyp++;
+ }
+
+ return snprintf(buff, len, "0x%" PRIx64, prkey);
}
static int
@@ -2721,7 +2735,20 @@ snprint_def_wwids_file (char * buff, int len, void * data)
static int
snprint_def_reservation_key(char * buff, int len, void * data)
{
- return snprintf(buff, len, "%s", conf->reservation_key);
+ int i;
+ unsigned char *keyp;
+ uint64_t prkey = 0;
+
+ if (!conf->reservation_key)
+ return 0;
+ keyp = (unsigned char *)conf->reservation_key;
+ for (i = 0; i < 8; i++) {
+ if (i > 0)
+ prkey <<= 8;
+ prkey |= *keyp;
+ keyp++;
+ }
+ return snprintf(buff, len, "0x%" PRIx64, prkey);
}
static int
diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
index 6053b5a..4df37fe 100644
--- a/multipathd/cli_handlers.c
+++ b/multipathd/cli_handlers.c
@@ -947,7 +947,7 @@ cli_getprstatus (void * v, char ** reply, int * len, void * data)
sprintf(*reply,"%d",mpp->prflag);
- *reply[1]='\0';
+ (*reply)[1]='\0';
condlog(3, "%s: reply = %s", param, *reply);
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH V3 13/18] multipath: make reservation_key print out correctly
2013-01-12 6:04 ` [PATCH V3 13/18] multipath: make reservation_key print out correctly Benjamin Marzinski
@ 2013-01-21 5:50 ` Chauhan, Vijay
0 siblings, 0 replies; 21+ messages in thread
From: Chauhan, Vijay @ 2013-01-21 5:50 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
Acked-by: Vijay Chauhan <vijay.chauhan@netapp.com>
Thanks,
Vijay
On January 12, 2013 11:35 AM; Benjamin Marzinski wrote:
>
>This patch fixes the reservation_key print functions, so they print
>it out like it was in the configuration file. Also, it keeps
>cli_getprstatus() from writing over random memory.
>
>Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
>---
> libmultipath/dict.c | 31 +++++++++++++++++++++++++++++--
> multipathd/cli_handlers.c | 2 +-
> 2 files changed, 30 insertions(+), 3 deletions(-)
>
>diff --git a/libmultipath/dict.c b/libmultipath/dict.c
>index 788ffae..a54dda9 100644
>--- a/libmultipath/dict.c
>+++ b/libmultipath/dict.c
>@@ -2052,8 +2052,22 @@ snprint_mp_prio_args(char * buff, int len, void *
>data)
> static int
> snprint_mp_reservation_key (char * buff, int len, void * data)
> {
>+ int i;
>+ unsigned char *keyp;
>+ uint64_t prkey = 0;
> struct mpentry * mpe = (struct mpentry *)data;
>- return snprintf(buff, len, "%s" , mpe->reservation_key);
>+
>+ if (!mpe->reservation_key)
>+ return 0;
>+ keyp = (unsigned char *)mpe->reservation_key;
>+ for (i = 0; i < 8; i++) {
>+ if (i > 0)
>+ prkey <<= 8;
>+ prkey |= *keyp;
>+ keyp++;
>+ }
>+
>+ return snprintf(buff, len, "0x%" PRIx64, prkey);
> }
>
> static int
>@@ -2721,7 +2735,20 @@ snprint_def_wwids_file (char * buff, int len, void *
>data)
> static int
> snprint_def_reservation_key(char * buff, int len, void * data)
> {
>- return snprintf(buff, len, "%s", conf->reservation_key);
>+ int i;
>+ unsigned char *keyp;
>+ uint64_t prkey = 0;
>+
>+ if (!conf->reservation_key)
>+ return 0;
>+ keyp = (unsigned char *)conf->reservation_key;
>+ for (i = 0; i < 8; i++) {
>+ if (i > 0)
>+ prkey <<= 8;
>+ prkey |= *keyp;
>+ keyp++;
>+ }
>+ return snprintf(buff, len, "0x%" PRIx64, prkey);
> }
>
> static int
>diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
>index 6053b5a..4df37fe 100644
>--- a/multipathd/cli_handlers.c
>+++ b/multipathd/cli_handlers.c
>@@ -947,7 +947,7 @@ cli_getprstatus (void * v, char ** reply, int * len,
>void * data)
>
>
> sprintf(*reply,"%d",mpp->prflag);
>- *reply[1]='\0';
>+ (*reply)[1]='\0';
>
>
> condlog(3, "%s: reply = %s", param, *reply);
>--
>1.8.0
>
>--
>dm-devel mailing list
>dm-devel@redhat.com
>https://www.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH V3 14/18] multipath: storagetek 6180 config
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
` (11 preceding siblings ...)
2013-01-12 6:04 ` [PATCH V3 13/18] multipath: make reservation_key print out correctly Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 15/18] multipath: Fix kpartx and udevd race Benjamin Marzinski
` (4 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
New StorageTek default config.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/hwtable.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index 6a8dfe3..6924a61 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -1018,6 +1018,21 @@ static struct hwentry default_hw[] = {
.prio_name = PRIO_RDAC,
.prio_args = NULL,
},
+ /* StorageTek 6180 */
+ {
+ .vendor = "SUN",
+ .product = "SUN_6180",
+ .features = DEFAULT_FEATURES,
+ .hwhandler = "1 rdac",
+ .pgpolicy = GROUP_BY_PRIO,
+ .pgfailback = -FAILBACK_IMMEDIATE,
+ .rr_weight = RR_WEIGHT_NONE,
+ .no_path_retry = NO_PATH_RETRY_QUEUE,
+ .minio = DEFAULT_MINIO,
+ .minio_rq = DEFAULT_MINIO_RQ,
+ .checker_name = RDAC,
+ .prio_name = PRIO_RDAC,
+ },
/* LSI/Engenio/NetApp E-Series RDAC storage */
{
.vendor = "(LSI|ENGENIO)",
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH V3 15/18] multipath: Fix kpartx and udevd race
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
` (12 preceding siblings ...)
2013-01-12 6:04 ` [PATCH V3 14/18] multipath: storagetek 6180 config Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 16/18] multipath: Check blacklists as soon as possible Benjamin Marzinski
` (3 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
Sometimes when kpartx is used to view partition data on disk image files,
udev still has the loop device open when kpartx is trying to tear it down.
This causes the LOOP_CLR_FD ioctl to fail with EBUSY. kpartx now retries
in this case.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
kpartx/lopart.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/kpartx/lopart.c b/kpartx/lopart.c
index 79d8328..b1007e1 100644
--- a/kpartx/lopart.c
+++ b/kpartx/lopart.c
@@ -286,6 +286,7 @@ set_loop (const char *device, const char *file, int offset, int *loopro)
extern int
del_loop (const char *device)
{
+ int retries = 3;
int fd;
if ((fd = open (device, O_RDONLY)) < 0) {
@@ -295,10 +296,17 @@ del_loop (const char *device)
return 1;
}
- if (ioctl (fd, LOOP_CLR_FD, 0) < 0) {
- perror ("ioctl: LOOP_CLR_FD");
- close (fd);
- return 1;
+ while (ioctl (fd, LOOP_CLR_FD, 0) < 0) {
+ if (errno != EBUSY || retries-- <= 0) {
+ perror ("ioctl: LOOP_CLR_FD");
+ close (fd);
+ return 1;
+ }
+ fprintf(stderr,
+ "loop: device %s still in use, retrying delete\n",
+ device);
+ sleep(1);
+ continue;
}
close (fd);
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH V3 16/18] multipath: Check blacklists as soon as possible
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
` (13 preceding siblings ...)
2013-01-12 6:04 ` [PATCH V3 15/18] multipath: Fix kpartx and udevd race Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 17/18] multipath: check for NULL from udev_device_get_* Benjamin Marzinski
` (2 subsequent siblings)
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
Multipath does a lot of unnecessary work on devices blacklisted by device
type or wwid before ignoring them. When dealing with a large number of
devices blacklisted this way, multipath can take long time to complete.
The patch makes sure that multipath is checking the blacklists as soon
as it has the necessary information to do so. To do this, pathinfo() now
takes another flag DI_BLACKLIST, which is only used by store_pathinfo(),
that tells it to check if the device should be blacklisted. Doing this
cleanly also required changing how store_pathinfo() and rlookup_binding()
are called.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/alias.c | 47 +++++++++++++++++--------------
libmultipath/alias.h | 2 +-
libmultipath/configure.c | 70 +++++++++++++++++++++++++++++++----------------
libmultipath/configure.h | 2 +-
libmultipath/discovery.c | 47 +++++++++++++++++++++++--------
libmultipath/discovery.h | 11 +++++---
libmultipath/util.c | 2 +-
multipath/main.c | 14 +++++-----
multipathd/cli_handlers.c | 11 ++++----
multipathd/main.c | 22 +++++++--------
10 files changed, 140 insertions(+), 88 deletions(-)
diff --git a/libmultipath/alias.c b/libmultipath/alias.c
index 2b42606..d913294 100644
--- a/libmultipath/alias.c
+++ b/libmultipath/alias.c
@@ -13,6 +13,9 @@
#include "uxsock.h"
#include "alias.h"
#include "file.h"
+#include "vector.h"
+#include "checkers.h"
+#include "structs.h"
/*
@@ -121,23 +124,23 @@ lookup_binding(FILE *f, char *map_wwid, char **map_alias, char *prefix)
}
static int
-rlookup_binding(FILE *f, char **map_wwid, char *map_alias)
+rlookup_binding(FILE *f, char *buff, char *map_alias)
{
- char buf[LINE_MAX];
+ char line[LINE_MAX];
unsigned int line_nr = 0;
int id = 0;
- *map_wwid = NULL;
+ buff[0] = '\0';
- while (fgets(buf, LINE_MAX, f)) {
+ while (fgets(line, LINE_MAX, f)) {
char *c, *alias, *wwid;
int curr_id;
line_nr++;
- c = strpbrk(buf, "#\n\r");
+ c = strpbrk(line, "#\n\r");
if (c)
*c = '\0';
- alias = strtok(buf, " \t");
+ alias = strtok(line, " \t");
if (!alias) /* blank line */
continue;
curr_id = scan_devname(alias, NULL); /* TBD: Why this call? */
@@ -150,13 +153,16 @@ rlookup_binding(FILE *f, char **map_wwid, char *map_alias)
line_nr);
continue;
}
+ if (strlen(wwid) > WWID_SIZE - 1) {
+ condlog(3,
+ "Ignoring too large wwid at %u in bindings file", line_nr);
+ continue;
+ }
if (strcmp(alias, map_alias) == 0){
condlog(3, "Found matching alias [%s] in bindings file."
"\nSetting wwid to %s", alias, wwid);
- *map_wwid = strdup(wwid);
- if (*map_wwid == NULL)
- condlog(0, "Cannot copy alias from bindings "
- "file : %s", strerror(errno));
+ strncpy(buff, wwid, WWID_SIZE);
+ buff[WWID_SIZE - 1] = '\0';
return id;
}
}
@@ -255,36 +261,35 @@ get_user_friendly_alias(char *wwid, char *file, char *prefix,
return alias;
}
-char *
-get_user_friendly_wwid(char *alias, char *file)
+int
+get_user_friendly_wwid(char *alias, char *buff, char *file)
{
- char *wwid;
- int fd, id, unused;
+ int fd, unused;
FILE *f;
if (!alias || *alias == '\0') {
condlog(3, "Cannot find binding for empty alias");
- return NULL;
+ return -1;
}
fd = open_file(file, &unused, BINDINGS_FILE_HEADER);
if (fd < 0)
- return NULL;
+ return -1;
f = fdopen(fd, "r");
if (!f) {
condlog(0, "cannot fdopen on bindings file descriptor : %s",
strerror(errno));
close(fd);
- return NULL;
+ return -1;
}
- id = rlookup_binding(f, &wwid, alias);
- if (id < 0) {
+ rlookup_binding(f, buff, alias);
+ if (!strlen(buff)) {
fclose(f);
- return NULL;
+ return -1;
}
fclose(f);
- return wwid;
+ return 0;
}
diff --git a/libmultipath/alias.h b/libmultipath/alias.h
index c625090..8ddd0b5 100644
--- a/libmultipath/alias.h
+++ b/libmultipath/alias.h
@@ -9,4 +9,4 @@
char *get_user_friendly_alias(char *wwid, char *file, char *prefix,
int bindings_readonly);
-char *get_user_friendly_wwid(char *alias, char *file);
+int get_user_friendly_wwid(char *alias, char *buff, char *file);
diff --git a/libmultipath/configure.c b/libmultipath/configure.c
index 131b5ad..e5048eb 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -676,21 +676,32 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, int force_r
return 0;
}
-extern char *
-get_refwwid (char * dev, enum devtypes dev_type, vector pathvec)
+/*
+ * returns:
+ * 0 - success
+ * 1 - failure
+ * 2 - blacklist
+ */
+extern int
+get_refwwid (char * dev, enum devtypes dev_type, vector pathvec, char **wwid)
{
+ int ret = 1;
struct path * pp;
char buff[FILE_NAME_SIZE];
char * refwwid = NULL, tmpwwid[WWID_SIZE];
+ if (!wwid)
+ return 1;
+ *wwid = NULL;
+
if (dev_type == DEV_NONE)
- return NULL;
+ return 1;
if (dev_type == DEV_DEVNODE) {
if (basenamecpy(dev, buff, FILE_NAME_SIZE) == 0) {
condlog(1, "basename failed for '%s' (%s)",
dev, buff);
- return NULL;
+ return 1;
}
pp = find_path_by_dev(pathvec, buff);
@@ -699,14 +710,16 @@ get_refwwid (char * dev, enum devtypes dev_type, vector pathvec)
if (!udevice) {
condlog(2, "%s: can't get udev device", buff);
- return NULL;
+ return 1;
}
- pp = store_pathinfo(pathvec, conf->hwtable, udevice,
- DI_SYSFS | DI_WWID);
+ ret = store_pathinfo(pathvec, conf->hwtable, udevice,
+ DI_SYSFS | DI_WWID, &pp);
udev_device_unref(udevice);
if (!pp) {
- condlog(0, "%s can't store path info", buff);
- return NULL;
+ if (ret == 1)
+ condlog(0, "%s can't store path info",
+ buff);
+ return ret;
}
}
refwwid = pp->wwid;
@@ -721,14 +734,16 @@ get_refwwid (char * dev, enum devtypes dev_type, vector pathvec)
if (!udevice) {
condlog(2, "%s: can't get udev device", dev);
- return NULL;
+ return 1;
}
- pp = store_pathinfo(pathvec, conf->hwtable, udevice,
- DI_SYSFS | DI_WWID);
+ ret = store_pathinfo(pathvec, conf->hwtable, udevice,
+ DI_SYSFS | DI_WWID, &pp);
udev_device_unref(udevice);
if (!pp) {
- condlog(0, "%s can't store path info", buff);
- return NULL;
+ if (ret == 1)
+ condlog(0, "%s can't store path info",
+ buff);
+ return ret;
}
}
refwwid = pp->wwid;
@@ -738,17 +753,17 @@ get_refwwid (char * dev, enum devtypes dev_type, vector pathvec)
if (((dm_get_uuid(dev, tmpwwid)) == 0) && (strlen(tmpwwid))) {
refwwid = tmpwwid;
- goto out;
+ goto check;
}
/*
* may be a binding
*/
- refwwid = get_user_friendly_wwid(dev,
- conf->bindings_file);
-
- if (refwwid)
- return refwwid;
+ if (get_user_friendly_wwid(dev, tmpwwid,
+ conf->bindings_file) == 0) {
+ refwwid = tmpwwid;
+ goto check;
+ }
/*
* or may be an alias
@@ -760,12 +775,21 @@ get_refwwid (char * dev, enum devtypes dev_type, vector pathvec)
*/
if (!refwwid)
refwwid = dev;
+
+check:
+ if (refwwid && strlen(refwwid)) {
+ if (filter_wwid(conf->blist_wwid, conf->elist_wwid,
+ refwwid) > 0)
+ return 2;
+ }
}
out:
- if (refwwid && strlen(refwwid))
- return STRDUP(refwwid);
+ if (refwwid && strlen(refwwid)) {
+ *wwid = STRDUP(refwwid);
+ return 0;
+ }
- return NULL;
+ return 1;
}
extern int reload_map(struct vectors *vecs, struct multipath *mpp, int refresh)
diff --git a/libmultipath/configure.h b/libmultipath/configure.h
index d13c0ac..650f080 100644
--- a/libmultipath/configure.h
+++ b/libmultipath/configure.h
@@ -27,6 +27,6 @@ int setup_map (struct multipath * mpp, char * params, int params_size );
int domap (struct multipath * mpp, char * params);
int reinstate_paths (struct multipath *mpp);
int coalesce_paths (struct vectors *vecs, vector curmp, char * refwwid, int force_reload);
-char * get_refwwid (char * dev, enum devtypes dev_type, vector pathvec);
+int get_refwwid (char * dev, enum devtypes dev_type, vector pathvec, char **wwid);
int reload_map(struct vectors *vecs, struct multipath *mpp, int refresh);
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 45570dc..b8a5cd1 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -28,37 +28,45 @@
#include "prio.h"
#include "defaults.h"
-struct path *
+int
store_pathinfo (vector pathvec, vector hwtable, struct udev_device *udevice,
- int flag)
+ int flag, struct path **pp_ptr)
{
+ int err = 1;
struct path * pp;
const char * devname;
+ if (pp_ptr)
+ *pp_ptr = NULL;
+
devname = udev_device_get_sysname(udevice);
if (!devname)
- return NULL;
+ return 1;
pp = alloc_path();
if (!pp)
- return NULL;
+ return 1;
if(safe_sprintf(pp->dev, "%s", devname)) {
condlog(0, "pp->dev too small");
goto out;
}
pp->udev = udev_device_ref(udevice);
- if (pathinfo(pp, hwtable, flag))
+ err = pathinfo(pp, hwtable, flag | DI_BLACKLIST);
+ if (err)
goto out;
- if (store_path(pathvec, pp))
+ err = store_path(pathvec, pp);
+ if (err)
goto out;
- return pp;
out:
- free_path(pp);
- return NULL;
+ if (err)
+ free_path(pp);
+ else if (pp_ptr)
+ *pp_ptr = pp;
+ return err;
}
static int
@@ -78,9 +86,11 @@ path_discover (vector pathvec, struct config * conf,
pp = find_path_by_dev(pathvec, (char *)devname);
if (!pp) {
- pp = store_pathinfo(pathvec, conf->hwtable,
- udevice, flag);
- return (pp ? 0 : 1);
+ if (store_pathinfo(pathvec, conf->hwtable,
+ udevice, flag, NULL) != 1)
+ return 0;
+ else
+ return 1;
}
return pathinfo(pp, conf->hwtable, flag);
}
@@ -857,6 +867,13 @@ pathinfo (struct path *pp, vector hwtable, int mask)
if (mask & DI_SYSFS && sysfs_pathinfo(pp))
return 1;
+ if (mask & DI_BLACKLIST && mask & DI_SYSFS) {
+ if (filter_device(conf->blist_device, conf->elist_device,
+ pp->vendor_id, pp->product_id) > 0) {
+ return 2;
+ }
+ }
+
path_state = path_offline(pp);
/*
@@ -896,6 +913,12 @@ pathinfo (struct path *pp, vector hwtable, int mask)
if (path_state == PATH_UP && (mask & DI_WWID) && !strlen(pp->wwid))
get_uid(pp);
+ if (mask & DI_BLACKLIST && mask & DI_WWID) {
+ if (filter_wwid(conf->blist_wwid, conf->elist_wwid,
+ pp->wwid) > 0) {
+ return 2;
+ }
+ }
/*
* Retrieve path priority, even for PATH_DOWN paths if it has never
diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h
index 17108c7..1a614ee 100644
--- a/libmultipath/discovery.h
+++ b/libmultipath/discovery.h
@@ -33,8 +33,9 @@ int do_tur (char *);
int path_offline (struct path *);
int get_state (struct path * pp, int daemon);
int pathinfo (struct path *, vector hwtable, int mask);
-struct path * store_pathinfo (vector pathvec, vector hwtable,
- struct udev_device *udevice, int flag);
+int store_pathinfo (vector pathvec, vector hwtable,
+ struct udev_device *udevice, int flag,
+ struct path **pp_ptr);
int sysfs_set_scsi_tmo (struct multipath *mpp);
int sysfs_get_timeout(struct path *pp, unsigned int *timeout);
@@ -46,14 +47,16 @@ enum discovery_mode {
__DI_SERIAL,
__DI_CHECKER,
__DI_PRIO,
- __DI_WWID
+ __DI_WWID,
+ __DI_BLACKLIST,
};
#define DI_SYSFS (1 << __DI_SYSFS)
#define DI_SERIAL (1 << __DI_SERIAL)
#define DI_CHECKER (1 << __DI_CHECKER)
#define DI_PRIO (1 << __DI_PRIO)
-#define DI_WWID (1 << __DI_WWID)
+#define DI_WWID (1 << __DI_WWID)
+#define DI_BLACKLIST (1 << __DI_BLACKLIST)
#define DI_ALL (DI_SYSFS | DI_SERIAL | DI_CHECKER | DI_PRIO | \
DI_WWID)
diff --git a/libmultipath/util.c b/libmultipath/util.c
index 3ac018c..41ac21b 100644
--- a/libmultipath/util.c
+++ b/libmultipath/util.c
@@ -27,7 +27,7 @@ basenamecpy (const char * str1, char * str2, int str2len)
if (!str1 || !strlen(str1))
return 0;
- if (strlen(str1) > str2len)
+ if (strlen(str1) >= str2len)
return 0;
if (!str2)
diff --git a/multipath/main.c b/multipath/main.c
index e526f7c..5d5a6f8 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -262,7 +262,7 @@ configure (void)
/*
* if we have a blacklisted device parameter, exit early
*/
- if (dev &&
+ if (dev && conf->dev_type == DEV_DEVNODE &&
(filter_devnode(conf->blist_devnode,
conf->elist_devnode, dev) > 0)) {
if (conf->dry_run == 2)
@@ -275,16 +275,16 @@ configure (void)
* failing the translation is fatal (by policy)
*/
if (conf->dev) {
- refwwid = get_refwwid(conf->dev, conf->dev_type, pathvec);
-
+ int failed = get_refwwid(conf->dev, conf->dev_type, pathvec,
+ &refwwid);
if (!refwwid) {
- condlog(3, "scope is nul");
+ if (failed == 2 && conf->dry_run == 2)
+ printf("%s is not a valid multipath device path\n", conf->dev);
+ else
+ condlog(3, "scope is nul");
goto out;
}
condlog(3, "scope limited to %s", refwwid);
- if (filter_wwid(conf->blist_wwid, conf->elist_wwid,
- refwwid) > 0)
- goto out;
if (conf->dry_run == 2) {
if (check_wwids_file(refwwid, 0) == 0){
printf("%s is a valid multipath device path\n", conf->dev);
diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
index 4df37fe..a1e4bde 100644
--- a/multipathd/cli_handlers.c
+++ b/multipathd/cli_handlers.c
@@ -433,19 +433,18 @@ cli_add_path (void * v, char ** reply, int * len, void * data)
udevice = udev_device_new_from_subsystem_sysname(conf->udev,
"block",
param);
- pp = store_pathinfo(vecs->pathvec, conf->hwtable,
- udevice, DI_ALL);
+ r = store_pathinfo(vecs->pathvec, conf->hwtable,
+ udevice, DI_ALL, &pp);
udev_device_unref(udevice);
if (!pp) {
+ if (r == 2)
+ goto blacklisted;
condlog(0, "%s: failed to store path info", param);
return 1;
}
pp->checkint = conf->checkint;
}
- r = ev_add_path(pp, vecs);
- if (r == 2)
- goto blacklisted;
- return r;
+ return ev_add_path(pp, vecs);
blacklisted:
*reply = strdup("blacklisted\n");
*len = strlen(*reply) + 1;
diff --git a/multipathd/main.c b/multipathd/main.c
index a6afebb..8c0866d 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -299,7 +299,7 @@ ev_add_map (char * dev, char * alias, struct vectors * vecs)
condlog(2, "%s: devmap %s registered", alias, dev);
return 0;
}
- refwwid = get_refwwid(dev, DEV_DEVMAP, vecs->pathvec);
+ r = get_refwwid(dev, DEV_DEVMAP, vecs->pathvec, &refwwid);
if (refwwid) {
r = coalesce_paths(vecs, NULL, refwwid, 0);
@@ -308,6 +308,8 @@ ev_add_map (char * dev, char * alias, struct vectors * vecs)
if (!r)
condlog(2, "%s: devmap %s added", alias, dev);
+ else if (r == 2)
+ condlog(2, "%s: uev_add_map %s blacklisted", alias, dev);
else
condlog(0, "%s: uev_add_map %s failed", alias, dev);
@@ -373,6 +375,7 @@ static int
uev_add_path (struct uevent *uev, struct vectors * vecs)
{
struct path *pp;
+ int ret;
condlog(2, "%s: add path (uevent)", uev->kernel);
if (strstr(uev->kernel, "..") != NULL) {
@@ -393,8 +396,11 @@ uev_add_path (struct uevent *uev, struct vectors * vecs)
/*
* get path vital state
*/
- if (!(pp = store_pathinfo(vecs->pathvec, conf->hwtable,
- uev->udev, DI_ALL))) {
+ ret = store_pathinfo(vecs->pathvec, conf->hwtable,
+ uev->udev, DI_ALL, &pp);
+ if (!pp) {
+ if (ret == 2)
+ return 0;
condlog(0, "%s: failed to store path info",
uev->kernel);
return 1;
@@ -402,14 +408,13 @@ uev_add_path (struct uevent *uev, struct vectors * vecs)
pp->checkint = conf->checkint;
}
- return (ev_add_path(pp, vecs) != 1)? 0 : 1;
+ return ev_add_path(pp, vecs);
}
/*
* returns:
* 0: added
* 1: error
- * 2: blacklisted
*/
int
ev_add_path (struct path * pp, struct vectors * vecs)
@@ -427,13 +432,6 @@ ev_add_path (struct path * pp, struct vectors * vecs)
condlog(0, "%s: failed to get path uid", pp->dev);
goto fail; /* leave path added to pathvec */
}
- if (filter_path(conf, pp) > 0){
- int i = find_slot(vecs->pathvec, (void *)pp);
- if (i != -1)
- vector_del_slot(vecs->pathvec, i);
- free_path(pp);
- return 2;
- }
mpp = pp->mpp = find_mp_by_wwid(vecs->mpvec, pp->wwid);
rescan:
if (mpp) {
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH V3 17/18] multipath: check for NULL from udev_device_get_*
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
` (14 preceding siblings ...)
2013-01-12 6:04 ` [PATCH V3 16/18] multipath: Check blacklists as soon as possible Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 6:04 ` [PATCH V3 18/18] multipath: make path devices readonly again Benjamin Marzinski
2013-01-12 13:16 ` [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Christophe Varoqui
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
The udev_device_get_* functions can return NULL, an occassionally do
so in the multipathd code. multipath needs to check if the result
is NULL before dereferencing it.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/discovery.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index b8a5cd1..831cfef 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -113,6 +113,7 @@ path_discovery (vector pathvec, struct config * conf, int flag)
udev_list_entry_foreach(entry,
udev_enumerate_get_list_entry(udev_iter)) {
+ const char *devtype;
devpath = udev_list_entry_get_name(entry);
condlog(4, "Discover device %s", devpath);
udevice = udev_device_new_from_syspath(conf->udev, devpath);
@@ -121,7 +122,8 @@ path_discovery (vector pathvec, struct config * conf, int flag)
r++;
continue;
}
- if(!strncmp(udev_device_get_devtype(udevice), "disk", 4))
+ devtype = udev_device_get_devtype(udevice);
+ if(devtype && !strncmp(devtype, "disk", 4))
r += path_discover(pathvec, conf, udevice, flag);
udev_device_unref(udevice);
}
@@ -459,7 +461,8 @@ scsi_sysfs_pathinfo (struct path * pp)
parent = pp->udev;
while (parent) {
- if (!strncmp(udev_device_get_subsystem(parent), "scsi", 4)) {
+ const char *subsys = udev_device_get_subsystem(parent);
+ if (subsys && !strncmp(subsys, "scsi", 4)) {
attr_path = udev_device_get_sysname(parent);
if (!attr_path)
break;
@@ -525,7 +528,8 @@ ccw_sysfs_pathinfo (struct path * pp)
parent = pp->udev;
while (parent) {
- if (!strncmp(udev_device_get_subsystem(parent), "ccw", 3))
+ const char *subsys = udev_device_get_subsystem(parent);
+ if (subsys && !strncmp(subsys, "ccw", 3))
break;
parent = udev_device_get_parent(parent);
}
@@ -581,7 +585,8 @@ cciss_sysfs_pathinfo (struct path * pp)
parent = pp->udev;
while (parent) {
- if (!strncmp(udev_device_get_subsystem(parent), "cciss", 5)) {
+ const char *subsys = udev_device_get_subsystem(parent);
+ if (subsys && !strncmp(subsys, "cciss", 5)) {
attr_path = udev_device_get_sysname(parent);
if (!attr_path)
break;
@@ -662,7 +667,8 @@ path_offline (struct path * pp)
parent = pp->udev;
while (parent) {
- if (!strncmp(udev_device_get_subsystem(parent), "scsi", 4))
+ const char *subsys = udev_device_get_subsystem(parent);
+ if (subsys && !strncmp(subsys, "scsi", 4))
break;
parent = udev_device_get_parent(parent);
}
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH V3 18/18] multipath: make path devices readonly again.
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
` (15 preceding siblings ...)
2013-01-12 6:04 ` [PATCH V3 17/18] multipath: check for NULL from udev_device_get_* Benjamin Marzinski
@ 2013-01-12 6:04 ` Benjamin Marzinski
2013-01-12 13:16 ` [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Christophe Varoqui
17 siblings, 0 replies; 21+ messages in thread
From: Benjamin Marzinski @ 2013-01-12 6:04 UTC (permalink / raw)
To: device-mapper development; +Cc: Christophe Varoqui
Path device fds were changed to be opened read/write when the
mpathpersist code was added. However, I have talked with Vijay, and
this doesn't appear to be necessary for mpathpersist to work correctly.
If the path fds are opened read/write, when the are closed a change
uevent is triggered, which was causing problems during shutdown with
LVM on top of multipath devices. This patch reverts them to being read-only
again.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/discovery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 831cfef..8b6f74d 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -886,7 +886,7 @@ pathinfo (struct path *pp, vector hwtable, int mask)
* fetch info not available through sysfs
*/
if (pp->fd < 0)
- pp->fd = open(udev_device_get_devnode(pp->udev), O_RDWR);
+ pp->fd = open(udev_device_get_devnode(pp->udev), O_RDONLY);
if (pp->fd < 0) {
condlog(4, "Couldn't open node for %s: %s",
--
1.8.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds
2013-01-12 6:04 [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Benjamin Marzinski
` (16 preceding siblings ...)
2013-01-12 6:04 ` [PATCH V3 18/18] multipath: make path devices readonly again Benjamin Marzinski
@ 2013-01-12 13:16 ` Christophe Varoqui
2013-01-14 7:03 ` Hannes Reinecke
17 siblings, 1 reply; 21+ messages in thread
From: Christophe Varoqui @ 2013-01-12 13:16 UTC (permalink / raw)
To: Benjamin Marzinski; +Cc: device-mapper development, Christophe Varoqui
On sam., 2013-01-12 at 00:04 -0600, Benjamin Marzinski wrote:
> This patch sets fast_io_fail to 5 seconds in the defaults section.
>
Merged 1-18.
Thanks.
I also imported the log_thread_flush() and log_reset() missing
functions from Hannes tree. Which makes the tree buildable again.
Best regards,
Christophe Varoqui
www.opensvc.com
> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
> libmultipath/config.c | 1 +
> libmultipath/defaults.h | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/libmultipath/config.c b/libmultipath/config.c
> index 0a56cd1..51b4f45 100644
> --- a/libmultipath/config.c
> +++ b/libmultipath/config.c
> @@ -516,6 +516,7 @@ load_config (char * file)
> conf->reassign_maps = DEFAULT_REASSIGN_MAPS;
> conf->checkint = DEFAULT_CHECKINT;
> conf->max_checkint = MAX_CHECKINT(conf->checkint);
> + conf->fast_io_fail = DEFAULT_FAST_IO_FAIL;
>
> /*
> * preload default hwtable
> diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
> index 74b236f..f647ee0 100644
> --- a/libmultipath/defaults.h
> +++ b/libmultipath/defaults.h
> @@ -15,6 +15,7 @@
> #define DEFAULT_USER_FRIENDLY_NAMES 0
> #define DEFAULT_VERBOSITY 2
> #define DEFAULT_REASSIGN_MAPS 1
> +#define DEFAULT_FAST_IO_FAIL 5
>
> #define DEFAULT_CHECKINT 5
> #define MAX_CHECKINT(a) (a << 2)
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds
2013-01-12 13:16 ` [PATCH V3 01/18] multipath: default fast_io_fail to 5 seconds Christophe Varoqui
@ 2013-01-14 7:03 ` Hannes Reinecke
0 siblings, 0 replies; 21+ messages in thread
From: Hannes Reinecke @ 2013-01-14 7:03 UTC (permalink / raw)
To: dm-devel
On 01/12/2013 02:16 PM, Christophe Varoqui wrote:
> On sam., 2013-01-12 at 00:04 -0600, Benjamin Marzinski wrote:
>> This patch sets fast_io_fail to 5 seconds in the defaults section.
>>
> Merged 1-18.
> Thanks.
>
> I also imported the log_thread_flush() and log_reset() missing
> functions from Hannes tree. Which makes the tree buildable again.
>
Yikes. Sorry.
I got sidetracked and forgot to check for that patch.
Thanks for fixing it up.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
^ permalink raw reply [flat|nested] 21+ messages in thread