Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Device-mapper Development (http://www.linux-archive.org/device-mapper-development/)
-   -   multipath-tools ./multipath.conf.annotated ./m ... (http://www.linux-archive.org/device-mapper-development/11409-multipath-tools-multipath-conf-annotated-m.html)

12-03-2007 05:42 PM

multipath-tools ./multipath.conf.annotated ./m ...
 
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL4_FC5
Changes by: bmarzins@sourceware.org 2007-12-03 18:42:15

Modified files:
. : multipath.conf.annotated
multipath.conf.defaults
libmultipath : hwtable.c

Log message:
Fix for bz #304481. Update hardware table with latest HP StorageWorks
parameters for RHEL4.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.annotated.diff?cvsroot=dm&only_with _tag=RHEL4_FC5&r1=1.16.2.2&r2=1.16.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.defaults.diff?cvsroot=dm&only_with_ tag=RHEL4_FC5&r1=1.5.2.8&r2=1.5.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/hwtable.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5& r1=1.16.2.12&r2=1.16.2.13

--- multipath-tools/multipath.conf.annotated 2007/10/19 21:41:56 1.16.2.2
+++ multipath-tools/multipath.conf.annotated 2007/12/03 18:42:15 1.16.2.3
@@ -11,7 +11,7 @@
# #
# # name : udev_dir
# # desc : directory where udev creates its device nodes
-# # default : /udev
+# # default : /dev
# #
# udev_dir /dev
#
@@ -67,7 +67,17 @@
# # exploitable prio value for example. "none" is a valid value
# # default : (null)
# #
-# #prio_callout "/bin/true"
+# prio_callout "/bin/true"
+#
+# #
+# # name : features
+# # scope : multipath
+# # desc : The default extra features of multipath devices. The
+# # only existing feature currently is queue_if_no_path.
+# # values : "1 queue_if_no_path"
+# # default : (null)
+# #
+# features "1 queue_if_no_path"
#
# #
# # name : path_checker
@@ -79,6 +89,17 @@
# path_checker readsector0
#
# #
+# # name : failback
+# # scope : multipathd
+# # desc : tell the daemon to manage path group failback, or not to.
+# # 0 means immediate failback, values >0 means deffered
+# # failback expressed in seconds.
+# # values : manual|immediate|n > 0
+# # default : immediate
+# #
+# failback manual
+#
+# #
# # name : rr_min_io
# # scope : multipath
# # desc : the number of IO to route to a path before switching
@@ -98,17 +119,6 @@
# rr_weight priorities
#
# #
-# # name : failback
-# # scope : multipathd
-# # desc : tell the daemon to manage path group failback, or not to.
-# # 0 means immediate failback, values >0 means deffered
-# # failback expressed in seconds.
-# # values : manual|immediate|n > 0
-# # default : immediate
-# #
-# failback manual
-#
-# #
# # name : no_path_retry
# # scope : multipath & multipathd
# # desc : tell the number of retries until disable queueing, or
@@ -197,17 +207,14 @@
# # priority value
# # group_by_node_name = 1 priority group per target
# # node name
-# # default : failover
# #
# path_grouping_policy multibus
#
# #
-# #
# # name : path_selector
# # desc : the path selector algorithm to use for this mpath
# # these algo are offered by the kernel mpath target
# # values : "round-robin 0"
-# # default : "round-robin 0"
# #
# path_selector "round-robin 0"
#
@@ -218,7 +225,6 @@
# # not to. 0 means immediate failback, values >0 means
# # deffered failback expressed in seconds.
# # values : manual|immediate|n > 0
-# # default : immediate
# #
# failback manual
#
@@ -228,7 +234,6 @@
# # desc : if set to priorities the multipath configurator will
# # assign path weights as "path prio * rr_min_io"
# # values : priorities|uniform
-# # default : uniform
# #
# rr_weight priorities
#
@@ -239,7 +244,6 @@
# # or "fail" means immediate failure (no queueing),
# # "queue" means never stop queueing
# # values : queue|fail|n (>0)
-# # default : (null)
# #
# no_path_retry queue
# }
@@ -253,7 +257,7 @@
##
## name : devices
## scope : multipath & multipathd
-## desc : list of per storage controler settings
+## desc : list of per storage controller settings
## overrides default settings (device_maps block)
## overriden by per multipath settings (multipaths block)
##
@@ -261,7 +265,7 @@
# #
# # name : device
# # scope : multipath & multipathd
-# # desc : settings for this specific storage controler
+# # desc : settings for this specific storage controller
# #
# device {
# #
@@ -280,14 +284,13 @@
# # blacklisted, the vendor, product, and bl_product
# # strings must all match, not just the vendor and
# # bl_product strings as in the upstream version.
-# # default : (null)
# bl_product "LUN_Z"
#
# #
# # name : path_grouping_policy
# # scope : multipath
# # desc : path grouping policy to apply to multipath hosted
-# # by this storage controler
+# # by this storage controller
# # values : failover = 1 path per priority group
# # multibus = all valid paths in 1 priority
# # group
@@ -297,7 +300,6 @@
# # priority value
# # group_by_node_name = 1 priority group per target
# # node name
-# # default : failover
# #
# path_grouping_policy multibus
#
@@ -306,49 +308,33 @@
# # scope : multipath
# # desc : the program and args to callout to obtain a unique
# # path identifier. Absolute path required
-# # default : /sbin/scsi_id -g -u -s
# #
# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
#
# #
-# # name : prio_callout
-# # scope : multipath
-# # desc : the program and args to callout to obtain a path
-# # weight. Weights are summed for each path group to
-# # determine the next PG to use case of failure.
-# # "none" is a valid value.
-# # default : no callout, all paths equals
+# # name : path_selector
+# # desc : the path selector algorithm to use for this mpath
+# # these algo are offered by the kernel mpath target
+# # values : "round-robin 0"
# #
-# prio_callout "/sbin/mpath_prio_balance_units %d"
+# path_selector "round-robin 0"
#
# #
# # name : path_checker
# # scope : multipathd
# # desc : path checking alorithm to use to check path state
-# # values : readsector0, tur
-# # default : readsector0
+# # values : readsector0|tur|emc_clariion|hp_sw|directio
# #
# path_checker readsector0
#
# #
-# # name : path_selector
-# # desc : the path selector algorithm to use for this mpath
-# # these algo are offered by the kernel mpath target
-# # values : "round-robin 0"
-# # default : "round-robin 0"
-# #
-# path_selector "round-robin 0"
-#
-# #
-# # name : failback
-# # scope : multipathd
-# # desc : tell the daemon to manage path group failback, or
-# # not to. 0 means immediate failback, values >0 means
-# # deffered failback expressed in seconds.
-# # values : manual|immediate|n > 0
-# # default : immediate
+# # name : features
+# # scope : multipath
+# # desc : The default extra features of multipath devices. The
+# # only existing feature currently is queue_if_no_path.
+# # values : "1 queue_if_no_path"
# #
-# failback 30
+# features "1 queue_if_no_path"
#
# #
# # name : hardware_handler
@@ -357,17 +343,35 @@
# # perform hardware specific actions when switching
# # path groups or handling IO errors
# # values : "0"|"1 emc"
-# # default : "0"
# #
# hardware_handler "1 emc"
#
# #
+# # name : prio_callout
+# # scope : multipath
+# # desc : the program and args to callout to obtain a path
+# # weight. Weights are summed for each path group to
+# # determine the next PG to use case of failure.
+# # "none" is a valid value.
+# #
+# prio_callout "/sbin/mpath_prio_balance_units %d"
+#
+# #
+# # name : failback
+# # scope : multipathd
+# # desc : tell the daemon to manage path group failback, or
+# # not to. 0 means immediate failback, values >0 means
+# # deffered failback expressed in seconds.
+# # values : manual|immediate|n > 0
+# #
+# failback 30
+#
+# #
# # name : rr_weight
# # scope : multipath
# # desc : if set to priorities the multipath configurator will
# # assign path weights as "path prio * rr_min_io"
# # values : priorities|uniform
-# # default : uniform
# #
# rr_weight priorities
#
@@ -378,7 +382,6 @@
# # or "fail" means immediate failure (no queueing),
# # "queue" means never stop queueing
# # values : queue|fail|n (>0)
-# # default : (null)
# #
# no_path_retry queue
# }
--- multipath-tools/multipath.conf.defaults 2007/10/19 21:41:56 1.5.2.8
+++ multipath-tools/multipath.conf.defaults 2007/12/03 18:42:15 1.5.2.9
@@ -20,6 +20,7 @@
#devnode_blacklist {
# devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
# devnode "^hd[a-z]"
+# devnode "^cciss!c[0-9]d[0-9]*"
#}
#
#devices {
@@ -35,59 +36,47 @@
# path_grouping_policy multibus
# getuid_callout "/sbin/scsi_id -g -u -s"
# }
+# device {
+# vendor "HP"
+# product "MSA2000s*"
+# getuid_callout "/sbin/cciss_id %n"
+# path_grouping_policy multibus
+# path_checker cciss_tur
+# no_path_retry 12
+# }
# device {
-# vendor "COMPAQ"
-# product "HSV110 (C)COMPAQ"
-# path_grouping_policy group_by_serial
-# getuid_callout "/sbin/scsi_id -g -u -s"
-# }
-# device {
-# vendor "COMPAQ"
-# product "HSV111 (C)COMPAQ"
+# vendor "(COMPAQ|HP)"
+# product "HSV(1|2).*"
# path_grouping_policy group_by_prio
# prio_callout "/sbin/mpath_prio_alua %d"
# path_checker tur
# failback immediate
-# no_path_retry 60
+# no_path_retry 12
# rr_min_io 100
-# }
+# }
# device {
-# vendor "HP"
-# product "HSV2[10]0"
-# path_grouping_policy group_by_prio
-# prio_callout "/sbin/mpath_prio_alua %d"
-# path_checker tur
+# vendor "(HITACHI|HP)"
+# product "OPEN-.*"
+# path_grouping_policy multibus
+# path_checker tur
# failback immediate
-# no_path_retry 60
+# no_path_retry 12
# rr_min_io 100
-# }
-# device {
-# vendor "{HITACHI|HP}"
-# product "OPEN-.*"
-# path_grouping_policy multibus
-# path_checker tur
-# }
+# }
# device {
# vendor "HP"
# product "*33[89]0*"
# path_grouping_policy multibus
# path_checker tur
-# }
-# device {
+# }
+# device {
# vendor "HP"
# product "MSA VOLUME"
# path_grouping_policy group_by_prio
# prio_callout "/sbin/mpath_prio_alua %d"
# path_checker tur
-# }
-# device {
-# vendor "HP"
-# product "HSV101"
-# path_grouping_policy group_by_prio
-# prio_callout "/sbin/mpath_prio_alua %n"
-# path_checker tur
# failback immediate
-# no_path_retry 60
+# no_path_retry 12
# rr_min_io 100
# }
# device {
@@ -143,12 +132,6 @@
# }
# device {
# vendor "HP"
-# product "HSV110"
-# path_grouping_policy group_by_serial
-# getuid_callout "/sbin/scsi_id -g -u -s"
-# }
-# device {
-# vendor "HP"
# product "A6189A"
# path_grouping_policy multibus
# getuid_callout "/sbin/scsi_id -g -u -s"
--- multipath-tools/libmultipath/hwtable.c 2007/09/11 18:06:01 1.16.2.12
+++ multipath-tools/libmultipath/hwtable.c 2007/12/03 18:42:15 1.16.2.13
@@ -20,7 +20,6 @@
r += store_hwe(hw, "EMC", "SYMMETRIX", MULTIBUS,
"/sbin/scsi_id -g -u -ppre-spc3-83 -s /block/%n");
r += store_hwe(hw, "FSC", "CentricStor", GROUP_BY_SERIAL, DEFAULT_GETUID);
- r += store_hwe(hw, "HP", "HSV110", GROUP_BY_SERIAL, DEFAULT_GETUID);
r += store_hwe(hw, "HP", "A6189A", MULTIBUS, DEFAULT_GETUID);
r += store_hwe(hw, "IBM", "ProFibre 4000R", MULTIBUS, DEFAULT_GETUID);
r += store_hwe(hw, "SGI", "TP9100", MULTIBUS, DEFAULT_GETUID);
@@ -32,21 +31,20 @@
r + store_hwe_ext(hw, "GNBD", "GNBD", MULTIBUS,
"/sbin/gnbd_import -q -U /block/%n", NULL, "0", "0",
"directio", FAILBACK_UNDEF, NULL, 0, 0, 0);
- r += store_hwe_ext(hw, "HP", "MSA VOLUME", GROUP_BY_PRIO, DEFAULT_GETUID,
- "/sbin/mpath_prio_alua %d", "0", "0", "tur", FAILBACK_UNDEF, NULL,
- 0, 0, 0);
- r += store_hwe_ext(hw, "HP", "HSV101", GROUP_BY_PRIO, DEFAULT_GETUID,
- "/sbin/mpath_prio_alua %n", "0", "0", "tur",
- -FAILBACK_IMMEDIATE, NULL, 60, 0, 100);
- r += store_hwe_ext(hw, "HP", "HSV2[10]0", GROUP_BY_PRIO, DEFAULT_GETUID,
- "/sbin/mpath_prio_alua %n", "0", "0", "tur",
- -FAILBACK_IMMEDIATE, NULL, 60, 0, 100);
- r += store_hwe_ext(hw, "COMPAQ", "HSV111", GROUP_BY_PRIO,
- DEFAULT_GETUID, "/sbin/mpath_prio_alua %n", "0", "0", "tur",
- -FAILBACK_IMMEDIATE, NULL, 60, 0, 100);
- r += store_hwe_ext(hw, "{HITACHI,HP}", "OPEN-.*", MULTIBUS,
+ r += store_hwe_ext(hw, "HP", "MSA VOLUME", GROUP_BY_PRIO,
+ DEFAULT_GETUID, "/sbin/mpath_prio_alua /dev/%n",
+ "0", "0", "tur", -FAILBACK_IMMEDIATE, NULL, 12, 0,
+ 100);
+ r += store_hwe_ext(hw, "(COMPAQ|HP)", "HSV(1|2).*", GROUP_BY_PRIO,
+ DEFAULT_GETUID, "/sbin/mpath_prio_alua /dev/%n",
+ "0", "0", "tur", -FAILBACK_IMMEDIATE, NULL, 12, 0,
+ 100);
+ r += store_hwe_ext(hw, "HP", "MSA2000s*", MULTIBUS, "/sbin/cciss_id %n",
+ NULL, "0", "0", "cciss_tur", FAILBACK_UNDEF, NULL,
+ 12, 0, 0);
+ r += store_hwe_ext(hw, "(HITACHI|HP)", "OPEN-.*", MULTIBUS,
DEFAULT_GETUID, NULL, "0", "0", "tur", -FAILBACK_IMMEDIATE,
- NULL, 60, 0, 100);
+ NULL, 12, 0, 100);
r += store_hwe_ext(hw, "HP", "*33[89]0*", MULTIBUS, DEFAULT_GETUID, NULL, "0", "0",
"tur", FAILBACK_UNDEF, NULL, 0, 0, 0);
r += store_hwe_ext(hw, "DGC", "*", GROUP_BY_PRIO,

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

01-15-2008 12:34 AM

multipath-tools ./multipath.conf.annotated ./m ...
 
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2008-01-15 01:34:36

Modified files:
. : multipath.conf.annotated
multipath.conf.synthetic
libmultipath : config.c config.h dict.c discovery.c structs.h
multipath : multipath.conf.redhat
multipathd : main.c

Log message:
Fix for bz 251346. Added a max_fds paramter to /etc/multipath.conf. This allows
you to set the maximum number of open fds that multipathd can use, like with
ulimit -n. Also added some code so that multipath closes the file descriptor
after it's used by the checker function, since multipath doesn't need to keep
them always open like multipathd does.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.annotated.diff?cvsroot=dm&only_with _tag=RHEL5_FC6&r1=1.18.2.4&r2=1.18.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.synthetic.diff?cvsroot=dm&only_with _tag=RHEL5_FC6&r1=1.11.2.2&r2=1.11.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r 1=1.19.2.4&r2=1.19.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r 1=1.18.2.2&r2=1.18.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/dict.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1= 1.17.2.3&r2=1.17.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/discovery.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC 6&r1=1.32.2.5&r2=1.32.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/structs.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6& r1=1.18.2.1&r2=1.18.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath/multipath.conf.redhat.diff?cvsroot=dm&only_with_ta g=RHEL5_FC6&r1=1.6.2.6&r2=1.6.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1= 1.69.2.4&r2=1.69.2.5

--- multipath-tools/multipath.conf.annotated 2008/01/14 23:49:34 1.18.2.4
+++ multipath-tools/multipath.conf.annotated 2008/01/15 01:34:36 1.18.2.5
@@ -80,6 +80,16 @@
# rr_min_io 100
#
# #
+# # name : max_fds
+# # scope : multipathd
+# # desc : Sets the maximum number of open file descriptors for the
+# # multipathd process.
+# # values : unlimited|n > 0
+# # default : None
+# #
+# max_fds 8192
+#
+# #
# # name : rr_weight
# # scope : multipath
# # desc : if set to priorities the multipath configurator will assign
--- multipath-tools/multipath.conf.synthetic 2007/06/19 18:12:15 1.11.2.2
+++ multipath-tools/multipath.conf.synthetic 2008/01/15 01:34:36 1.11.2.3
@@ -11,6 +11,7 @@
# prio_callout /bin/true
# path_checker readsector0
# rr_min_io 100
+# max_fds 8192
# rr_weight priorities
# failback immediate
# no_path_retry fail
--- multipath-tools/libmultipath/config.c 2007/12/15 00:27:39 1.19.2.4
+++ multipath-tools/libmultipath/config.c 2008/01/15 01:34:36 1.19.2.5
@@ -411,6 +411,7 @@

conf->dev_type = DEV_NONE;
conf->minio = 1000;
+ conf->max_fds = 0;

/*
* read the config file
--- multipath-tools/libmultipath/config.h 2007/12/15 00:27:39 1.18.2.2
+++ multipath-tools/libmultipath/config.h 2008/01/15 01:34:36 1.18.2.3
@@ -63,6 +63,7 @@
int no_path_retry;
int user_friendly_names;
int pg_timeout;
+ int max_fds;

char * dev;
char * udev_dir;
--- multipath-tools/libmultipath/dict.c 2007/12/15 00:27:39 1.17.2.3
+++ multipath-tools/libmultipath/dict.c 2008/01/15 01:34:36 1.17.2.4
@@ -143,6 +143,26 @@
}

static int
+max_fds_handler(vector strvec)
+{
+ char * buff;
+
+ buff = set_value(strvec);
+
+ if (!buff)
+ return 1;
+
+ if (strlen(buff) == 9 &&
+ !strcmp(buff, "unlimited"))
+ conf->max_fds = MAX_FDS_UNLIMITED;
+ else
+ conf->max_fds = atoi(buff);
+ FREE(buff);
+
+ return 0;
+}
+
+static int
def_weight_handler(vector strvec)
{
char * buff;
@@ -1441,6 +1461,17 @@
}

static int
+snprint_max_fds (char * buff, int len, void * data)
+{
+ if (!conf->max_fds)
+ return 0;
+
+ if (conf->max_fds < 0)
+ return snprintf(buff, len, "unlimited");
+ return snprintf(buff, len, "%d", conf->max_fds);
+}
+
+static int
snprint_def_rr_weight (char * buff, int len, void * data)
{
if (!conf->rr_weight)
@@ -1553,6 +1584,7 @@
install_keyword("path_checker", &def_path_checker_handler, &snprint_def_path_checker);
install_keyword("failback", &default_failback_handler, &snprint_def_failback);
install_keyword("rr_min_io", &def_minio_handler, &snprint_def_rr_min_io);
+ install_keyword("max_fds", &max_fds_handler, &snprint_max_fds);
install_keyword("rr_weight", &def_weight_handler, &snprint_def_rr_weight);
install_keyword("no_path_retry", &def_no_path_retry_handler, &snprint_def_no_path_retry);
install_keyword("pg_timeout", &def_pg_timeout_handler, &snprint_def_pg_timeout);
--- multipath-tools/libmultipath/discovery.c 2007/06/18 17:37:18 1.32.2.5
+++ multipath-tools/libmultipath/discovery.c 2008/01/15 01:34:36 1.32.2.6
@@ -820,6 +820,10 @@
if (mask & DI_WWID && !strlen(pp->wwid))
get_uid(pp);

+#ifndef DAEMON
+ close(pp->fd);
+ pp->fd = -1;
+#endif
return 0;

blank:
@@ -828,5 +832,11 @@
*/
memset(pp->wwid, 0, WWID_SIZE);
pp->state = PATH_DOWN;
+#ifndef DAEMON
+ if (pp->fd > 0){
+ close(pp->fd);
+ pp->fd = -1;
+ }
+#endif
return 0;
}
--- multipath-tools/libmultipath/structs.h 2007/06/18 17:37:18 1.18.2.1
+++ multipath-tools/libmultipath/structs.h 2008/01/15 01:34:36 1.18.2.2
@@ -18,6 +18,8 @@
#define NO_PATH_RETRY_FAIL -1
#define NO_PATH_RETRY_QUEUE -2

+#define MAX_FDS_UNLIMITED -1
+
enum free_path_switch {
KEEP_PATHS,
FREE_PATHS
--- multipath-tools/multipath/multipath.conf.redhat 2008/01/02 19:06:12 1.6.2.6
+++ multipath-tools/multipath/multipath.conf.redhat 2008/01/15 01:34:36 1.6.2.7
@@ -39,6 +39,7 @@
# prio_callout /bin/true
# path_checker readsector0
# rr_min_io 100
+# max_fds 8192
# rr_weight priorities
# failback immediate
# no_path_retry fail
--- multipath-tools/multipathd/main.c 2007/12/17 22:27:38 1.69.2.4
+++ multipath-tools/multipathd/main.c 2008/01/15 01:34:36 1.69.2.5
@@ -13,6 +13,8 @@
#include <sys/mount.h>
#include <fcntl.h>
#include <errno.h>
+#include <sys/time.h>
+#include <sys/resource.h>

/*
* libsysfs
@@ -1451,6 +1453,21 @@
conf->max_checkint = MAX_CHECKINT(conf->checkint);
}

+ if (conf->max_fds) {
+ struct rlimit fd_limit;
+ if (conf->max_fds > 0) {
+ fd_limit.rlim_cur = conf->max_fds;
+ fd_limit.rlim_max = conf->max_fds;
+ }
+ else {
+ fd_limit.rlim_cur = RLIM_INFINITY;
+ fd_limit.rlim_max = RLIM_INFINITY;
+ }
+ if (setrlimit(RLIMIT_NOFILE, &fd_limit) < 0)
+ condlog(0, "can't set open fds limit to %d : %s
",
+ conf->max_fds, strerror(errno));
+ }
+
if (pidfile_create(DEFAULT_PIDFILE, getpid())) {
if (logsink)
log_thread_stop();

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

04-14-2008 10:32 PM

multipath-tools ./multipath.conf.annotated ./m ...
 
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL4_FC5
Changes by: bmarzins@sourceware.org 2008-04-14 22:32:04

Modified files:
. : multipath.conf.annotated
multipath.conf.synthetic
kpartx : devmapper.c devmapper.h kpartx.c
libmultipath : config.c config.h devmapper.c devmapper.h
dict.c propsel.c propsel.h structs.h
multipath : main.c

Log message:
Fix for bz #251388. Added three new parameters to /etc/multipath.conf:
mode, uid, and gid. These can be used to override the default values when
multipath device nodes are created. Unfortunately, you cannot do name
resolution with static binaries, since you must load libnss dynamically, so
uid and gid must use the numerical user id and group id.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.annotated.diff?cvsroot=dm&only_with _tag=RHEL4_FC5&r1=1.16.2.4&r2=1.16.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.synthetic.diff?cvsroot=dm&only_with _tag=RHEL4_FC5&r1=1.10.2.1&r2=1.10.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/kpartx/devmapper.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC 5&r1=1.6.2.1&r2=1.6.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/kpartx/devmapper.h.diff?cvsroot=dm&only_with_tag=RHEL4_FC 5&r1=1.3.2.1&r2=1.3.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/kpartx/kpartx.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r 1=1.7.2.2&r2=1.7.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r 1=1.17.2.2&r2=1.17.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.h.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r 1=1.17.2.2&r2=1.17.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/devmapper.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC 5&r1=1.18.2.1&r2=1.18.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/devmapper.h.diff?cvsroot=dm&only_with_tag=RHEL4_FC 5&r1=1.10&r2=1.10.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/dict.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1= 1.16.2.3&r2=1.16.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/propsel.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5& r1=1.9.2.1&r2=1.9.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/propsel.h.diff?cvsroot=dm&only_with_tag=RHEL4_FC5& r1=1.4.2.1&r2=1.4.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/structs.h.diff?cvsroot=dm&only_with_tag=RHEL4_FC5& r1=1.17.2.6&r2=1.17.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath/main.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1= 1.41.2.6&r2=1.41.2.7

--- multipath-tools/multipath.conf.annotated 2008/01/25 22:30:00 1.16.2.4
+++ multipath-tools/multipath.conf.annotated 2008/04/14 22:32:03 1.16.2.5
@@ -161,6 +161,32 @@
# # default : "/var/lib/multipath/bindings"
# bindings_file "/etc/multipath_bindings"
#
+# #
+# # name : mode
+# # scope : multipath
+# # desc : The mode to use for the multipath device nodes, in octal.
+# # values : 0000 - 0777
+# # default : determined by the process
+# mode 0644
+#
+# #
+# # name : uid
+# # scope : multipath
+# # desc : The user id to use for the multipath device nodes. You
+# # must use the numeric user id.
+# # values : <user_id_number>
+# # default : determined by the process
+# uid 0
+#
+# #
+# # name : gid
+# # scope : multipath
+# # desc : The group id to use for the multipath device nodes. You
+# # must use the numeric group id.
+# # values : <group_id_number>
+# # default : determined by the process
+# gid 0
+#
#}
#
##
@@ -256,6 +282,33 @@
# # values : queue|fail|n (>0)
# #
# no_path_retry queue
+# #
+# # name : mode
+# # scope : multipath
+# # desc : The mode to use for the multipath device node,
+# # in octal.
+# # values : 0000 - 0777
+# # default : determined by the process
+# mode 0644
+#
+# #
+# # name : uid
+# # scope : multipath
+# # desc : The user id to use for the multipath device node.
+# # You must use the numeric user id.
+# # values : <user_id_number>
+# # default : determined by the process
+# uid 0
+#
+# #
+# # name : gid
+# # scope : multipath
+# # desc : The group id to use for the multipath device node.
+# # You must use the numeric group id.
+# # values : <group_id_number>
+# # default : determined by the process
+# gid 0
+#
# }
# multipath {
# wwid 1DEC_____321816758474
--- multipath-tools/multipath.conf.synthetic 2008/01/25 22:30:00 1.10.2.1
+++ multipath-tools/multipath.conf.synthetic 2008/04/14 22:32:03 1.10.2.2
@@ -16,6 +16,9 @@
# failback immediate
# no_path_retry fail
# user_friendly_name yes
+# mode 0666
+# uid 0
+# gid 0
#}
#devnode_blacklist {
# wwid 26353900f02796769
--- multipath-tools/kpartx/devmapper.c 2006/09/19 21:06:40 1.6.2.1
+++ multipath-tools/kpartx/devmapper.c 2008/04/14 22:32:04 1.6.2.2
@@ -72,7 +72,8 @@

extern int
dm_addmap (int task, const char *name, const char *target,
- const char *params, unsigned long size, const char *uuid, int part) {
+ const char *params, unsigned long size, const char *uuid, int part,
+ mode_t mode, uid_t uid, gid_t gid) {
int r = 0;
struct dm_task *dmt;
char *prefixed_uuid = NULL;
@@ -98,6 +99,13 @@
goto freeout;
}

+ if (!dm_task_set_mode(dmt, mode))
+ goto freeout;
+ if (!dm_task_set_uid(dmt, uid))
+ goto freeout;
+ if (!dm_task_set_gid(dmt, gid))
+ goto freeout;
+
dm_task_no_open_count(dmt);

r = dm_task_run (dmt);
--- multipath-tools/kpartx/devmapper.h 2006/09/19 21:06:40 1.3.2.1
+++ multipath-tools/kpartx/devmapper.h 2008/04/14 22:32:04 1.3.2.2
@@ -1,7 +1,7 @@
int dm_prereq (char *, int, int, int);
int dm_simplecmd (int, const char *);
int dm_addmap (int, const char *, const char *, const char *, unsigned long,
- char *, int);
+ char *, int, mode_t, uid_t, gid_t);
int dm_map_present (char *);
const char * dm_mapname(int major, int minor);
dev_t dm_get_first_dep(char *devname);
--- multipath-tools/kpartx/kpartx.c 2007/10/19 21:41:56 1.7.2.2
+++ multipath-tools/kpartx/kpartx.c 2008/04/14 22:32:04 1.7.2.3
@@ -511,7 +511,9 @@
DM_DEVICE_RELOAD : DM_DEVICE_CREATE);

dm_addmap(op, partname, DM_TARGET, params,
- slices[j].size, uuid, j+1);
+ slices[j].size, uuid, j+1,
+ buf.st_mode & 0777, buf.st_uid,
+ buf.st_gid);

if (op == DM_DEVICE_RELOAD)
dm_simplecmd(DM_DEVICE_RESUME,
--- multipath-tools/libmultipath/config.c 2008/01/25 22:30:00 1.17.2.2
+++ multipath-tools/libmultipath/config.c 2008/04/14 22:32:04 1.17.2.3
@@ -407,6 +407,7 @@
conf->dev_type = DEV_NONE;
conf->rr_min_io = DEFAULT_RR_MIN_IO;
conf->max_fds = 0;
+ conf->attribute_flags = 0;
conf->bindings_file = DEFAULT_BINDINGS_FILE;

/*
--- multipath-tools/libmultipath/config.h 2008/01/25 22:30:00 1.17.2.2
+++ multipath-tools/libmultipath/config.h 2008/04/14 22:32:04 1.17.2.3
@@ -1,6 +1,8 @@
#ifndef _CONFIG_H
#define _CONFIG_H

+#include <sys/types.h>
+
#ifndef _VECTOR_H
#include "vector.h"
#endif
@@ -41,6 +43,10 @@
int rr_weight;
int no_path_retry;
int pg_timeout;
+ int attribute_flags;
+ uid_t uid;
+ gid_t gid;
+ mode_t mode;

char * wwid;
char * selector;
@@ -68,6 +74,10 @@
int user_friendly_names;
int pg_timeout;
int max_fds;
+ int attribute_flags;
+ uid_t uid;
+ gid_t gid;
+ mode_t mode;

char * dev;
char * udev_dir;
--- multipath-tools/libmultipath/devmapper.c 2007/07/31 22:19:56 1.18.2.1
+++ multipath-tools/libmultipath/devmapper.c 2008/04/14 22:32:04 1.18.2.2
@@ -111,40 +111,48 @@
}

extern int
-dm_addmap (int task, const char *name, const char *target,
- const char *params, unsigned long long size, const char *uuid) {
+dm_addmap (int task, const char *target, struct multipath *mpp, int use_wwid) {
int r = 0;
struct dm_task *dmt;
- char *prefixed_uuid = NULL;
+ char *prefixed_wwid = NULL;

if (!(dmt = dm_task_create (task)))
return 0;

- if (!dm_task_set_name (dmt, name))
+ if (!dm_task_set_name (dmt, mpp->alias))
goto addout;

- if (!dm_task_add_target (dmt, 0, size, target, params))
+ if (!dm_task_add_target (dmt, 0, mpp->size, target, mpp->params))
goto addout;

- if (uuid) {
- prefixed_uuid = MALLOC(UUID_PREFIX_LEN + strlen(uuid) + 1);
- if (!prefixed_uuid) {
+ if (use_wwid && mpp->wwid) {
+ prefixed_wwid = MALLOC(UUID_PREFIX_LEN + strlen(mpp->wwid) + 1);
+ if (!prefixed_wwid) {
condlog(0, "cannot create prefixed uuid : %s
",
strerror(errno));
goto addout;
}
- sprintf(prefixed_uuid, UUID_PREFIX "%s", uuid);
- if (!dm_task_set_uuid(dmt, prefixed_uuid))
+ sprintf(prefixed_wwid, UUID_PREFIX "%s", mpp->wwid);
+ if (!dm_task_set_uuid(dmt, prefixed_wwid))
goto freeout;
}

+ if (mpp->attribute_flags & (1 << ATTR_MODE) &&
+ !dm_task_set_mode(dmt, mpp->mode))
+ goto freeout;
+ if (mpp->attribute_flags & (1 << ATTR_UID) &&
+ !dm_task_set_uid(dmt, mpp->uid))
+ goto freeout;
+ if (mpp->attribute_flags & (1 << ATTR_GID) &&
+ !dm_task_set_gid(dmt, mpp->gid))
+ goto freeout;
dm_task_no_open_count(dmt);

r = dm_task_run (dmt);

freeout:
- if (prefixed_uuid)
- free(prefixed_uuid);
+ if (prefixed_wwid)
+ free(prefixed_wwid);

addout:
dm_task_destroy (dmt);
--- multipath-tools/libmultipath/devmapper.h 2005/11/04 23:35:28 1.10
+++ multipath-tools/libmultipath/devmapper.h 2008/04/14 22:32:04 1.10.2.1
@@ -2,8 +2,7 @@
void dm_restore_log(void);
int dm_prereq (char *, int, int, int);
int dm_simplecmd (int, const char *);
-int dm_addmap (int, const char *, const char *, const char *,
- unsigned long long, const char *uuid);
+int dm_addmap (int, const char *, struct multipath *mpp, int use_wwid);
int dm_map_present (char *);
int dm_get_map(char *, unsigned long long *, char *);
int dm_get_status(char *, char *);
--- multipath-tools/libmultipath/dict.c 2008/01/25 22:30:00 1.16.2.3
+++ multipath-tools/libmultipath/dict.c 2008/04/14 22:32:04 1.16.2.4
@@ -4,6 +4,9 @@
* Copyright (c) 2005 Benjamin Marzinski, Redhat
* Copyright (c) 2005 Kiyoshi Ueda, NEC
*/
+#include <sys/types.h>
+#include <pwd.h>
+
#include "vector.h"
#include "hwtable.h"
#include "structs.h"
@@ -160,6 +163,79 @@
}

static int
+def_mode_handler(vector strvec)
+{
+ mode_t mode;
+ char *buff;
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+
+ if (sscanf(buff, "%o", &mode) == 1 && mode <= 0777){
+ conf->attribute_flags |= (1 << ATTR_MODE);
+ conf->mode = mode;
+ }
+
+ FREE(buff);
+ return 0;
+}
+
+static int
+def_uid_handler(vector strvec)
+{
+ uid_t uid;
+ char *buff;
+ /*
+ char passwd_buf[1024];
+ struct passwd info, *found;
+ */
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+ /* Can't do this for statically linked binaries, because libnss
+ must be dynamically loaded. When we can use dynamically link
+ binaries in the initramfs, we can put this back */
+ /*if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
+ conf->attribute_flags |= (1 << ATTR_UID);
+ conf->uid = info.pw_uid;
+ }
+ else */if (sscanf(buff, "%u", &uid) == 1){
+ conf->attribute_flags |= (1 << ATTR_UID);
+ conf->uid = uid;
+ }
+ FREE(buff);
+ return 0;
+}
+
+static int
+def_gid_handler(vector strvec)
+{
+ gid_t gid;
+ char *buff;
+ /*
+ char passwd_buf[1024];
+ struct passwd info, *found;
+ */
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+
+ /*if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
+ conf->attribute_flags |= (1 << ATTR_GID);
+ conf->gid = info.pw_gid;
+ }
+ else */if (sscanf(buff, "%u", &gid) == 1){
+ conf->attribute_flags |= (1 << ATTR_GID);
+ conf->gid = gid;
+ }
+ FREE(buff);
+ return 0;
+}
+
+static int
def_weight_handler(vector strvec)
{
char * buff;
@@ -781,6 +857,88 @@
}

static int
+mp_mode_handler(vector strvec)
+{
+ mode_t mode;
+ struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
+ char *buff;
+
+ if (!mpe)
+ return 1;
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+ if (sscanf(buff, "%o", &mode) == 1 && mode <= 0777){
+ mpe->attribute_flags |= (1 << ATTR_MODE);
+ mpe->mode = mode;
+ }
+
+ FREE(buff);
+ return 0;
+}
+
+static int
+mp_uid_handler(vector strvec)
+{
+ uid_t uid;
+ char *buff;
+ /*
+ char passwd_buf[1024];
+ struct passwd info, *found;
+ */
+ struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
+
+ if (!mpe)
+ return 1;
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+
+ /*if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
+ mpe->attribute_flags |= (1 << ATTR_UID);
+ mpe->uid = info.pw_uid;
+ }
+ else */if (sscanf(buff, "%u", &uid) == 1){
+ mpe->attribute_flags |= (1 << ATTR_UID);
+ mpe->uid = uid;
+ }
+ FREE(buff);
+ return 0;
+}
+
+static int
+mp_gid_handler(vector strvec)
+{
+ gid_t gid;
+ char *buff;
+ /*
+ char passwd_buf[1024];
+ struct passwd info, *found;
+ */
+ struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
+
+ if (!mpe)
+ return 1;
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+
+ /*if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
+ mpe->attribute_flags |= (1 << ATTR_GID);
+ mpe->gid = info.pw_gid;
+ }
+ else */if (sscanf(buff, "%u", &gid) == 1){
+ mpe->attribute_flags |= (1 << ATTR_GID);
+ mpe->gid = gid;
+ }
+ FREE(buff);
+ return 0;
+}
+
+static int
mp_pg_timeout_handler(vector strvec)
{
int pg_timeout;
@@ -832,6 +990,9 @@
install_keyword("pg_timeout", &default_pg_timeout_handler);
install_keyword("user_friendly_names", &names_handler);
install_keyword("bindings_file", &bindings_file_handler);
+ install_keyword("mode", &def_mode_handler);
+ install_keyword("uid", &def_uid_handler);
+ install_keyword("gid", &def_gid_handler);

/*
* deprecated synonyms
@@ -877,6 +1038,9 @@
install_keyword("rr_weight", &mp_weight_handler);
install_keyword("no_path_retry", &mp_no_path_retry_handler);
install_keyword("pg_timeout", &mp_pg_timeout_handler);
+ install_keyword("mode", &mp_mode_handler);
+ install_keyword("uid", &mp_uid_handler);
+ install_keyword("gid", &mp_gid_handler);
install_sublevel_end();

return keywords;
--- multipath-tools/libmultipath/propsel.c 2006/12/01 23:45:18 1.9.2.1
+++ multipath-tools/libmultipath/propsel.c 2008/04/14 22:32:04 1.9.2.2
@@ -173,6 +173,60 @@
}

extern int
+select_mode (struct multipath *mp)
+{
+ if (mp->mpe && (mp->mpe->attribute_flags & (1 << ATTR_MODE))) {
+ mp->attribute_flags |= (1 << ATTR_MODE);
+ mp->mode = mp->mpe->mode;
+ condlog(3, "mode = 0%o (multipath setting)", mp->mode);
+ }
+ else if (conf->attribute_flags & (1 << ATTR_MODE)) {
+ mp->attribute_flags |= (1 << ATTR_MODE);
+ mp->mode = conf->mode;
+ condlog(3, "mode = 0%o (config file default)", mp->mode);
+ }
+ else
+ mp->attribute_flags &= ~(1 << ATTR_MODE);
+ return 0;
+}
+
+extern int
+select_uid (struct multipath *mp)
+{
+ if (mp->mpe && (mp->mpe->attribute_flags & (1 << ATTR_UID))) {
+ mp->attribute_flags |= (1 << ATTR_UID);
+ mp->uid = mp->mpe->uid;
+ condlog(3, "uid = %u (multipath setting)", mp->uid);
+ }
+ else if (conf->attribute_flags & (1 << ATTR_UID)) {
+ mp->attribute_flags |= (1 << ATTR_UID);
+ mp->uid = conf->uid;
+ condlog(3, "uid = %u (config file default)", mp->uid);
+ }
+ else
+ mp->attribute_flags &= ~(1 << ATTR_UID);
+ return 0;
+}
+
+extern int
+select_gid (struct multipath *mp)
+{
+ if (mp->mpe && (mp->mpe->attribute_flags & (1 << ATTR_GID))) {
+ mp->attribute_flags |= (1 << ATTR_GID);
+ mp->gid = mp->mpe->gid;
+ condlog(3, "gid = %u (multipath setting)", mp->gid);
+ }
+ else if (conf->attribute_flags & (1 << ATTR_GID)) {
+ mp->attribute_flags |= (1 << ATTR_GID);
+ mp->gid = conf->gid;
+ condlog(3, "gid = %u (config file default)", mp->gid);
+ }
+ else
+ mp->attribute_flags &= ~(1 << ATTR_GID);
+ return 0;
+}
+
+extern int
select_features (struct multipath * mp)
{
if (mp->hwe && mp->hwe->features) {
--- multipath-tools/libmultipath/propsel.h 2006/12/01 23:45:18 1.4.2.1
+++ multipath-tools/libmultipath/propsel.h 2008/04/14 22:32:04 1.4.2.2
@@ -11,3 +11,6 @@
int select_no_path_retry(struct multipath *mp);
int select_pg_timeout(struct multipath *mp);
int select_rr_min_io(struct multipath *mp);
+int select_mode(struct multipath *mp);
+int select_uid(struct multipath *mp);
+int select_gid(struct multipath *mp);
--- multipath-tools/libmultipath/structs.h 2008/01/25 22:30:00 1.17.2.6
+++ multipath-tools/libmultipath/structs.h 2008/04/14 22:32:04 1.17.2.7
@@ -1,6 +1,8 @@
#ifndef _STRUCTS_H
#define _STRUCTS_H

+#include <sys/types.h>
+
#define WWID_SIZE 128
#define SERIAL_SIZE 64
#define NODE_NAME_SIZE 19
@@ -63,6 +65,12 @@
PGTIMEOUT_NONE
};

+enum attribute_bits {
+ ATTR_UID,
+ ATTR_GID,
+ ATTR_MODE,
+};
+
struct scsi_idlun {
int dev_id;
int host_unique_id;
@@ -133,6 +141,11 @@
int no_path_retry; /* number of retries after all paths are down */
int retry_tick; /* remaining times for retries */
int pg_timeout;
+ int attribute_flags;
+ uid_t uid;
+ gid_t gid;
+ mode_t mode;
+
unsigned long long size;
vector paths;
vector pg;
--- multipath-tools/multipath/main.c 2007/12/17 23:15:22 1.41.2.6
+++ multipath-tools/multipath/main.c 2008/04/14 22:32:04 1.41.2.7
@@ -1,7 +1,7 @@
/*
* Soft: multipath device mapper target autoconfig
*
- * Version: $Id: main.c,v 1.41.2.6 2007/12/17 23:15:22 bmarzins Exp $
+ * Version: $Id: main.c,v 1.41.2.7 2008/04/14 22:32:04 bmarzins Exp $
*
* Author: Christophe Varoqui
*
@@ -33,7 +33,6 @@
#include <vector.h>
#include <memory.h>
#include <libdevmapper.h>
-#include <devmapper.h>
#include <checkers.h>
#include <path_state.h>
#include <blacklist.h>
@@ -51,6 +50,7 @@
#include <sysfs/libsysfs.h>
#include <print.h>
#include <alias.h>
+#include <devmapper.h>

#include "main.h"
#include "pgpolicies.h"
@@ -669,8 +669,7 @@
if (dm_map_present(mpp->alias))
break;

- r = dm_addmap(DM_DEVICE_CREATE, mpp->alias, DEFAULT_TARGET,
- mpp->params, mpp->size, mpp->wwid);
+ r = dm_addmap(DM_DEVICE_CREATE, DEFAULT_TARGET, mpp, 1);

/*
* DM_DEVICE_CREATE is actually DM_DEV_CREATE plus
@@ -689,8 +688,7 @@
break;

case ACT_RELOAD:
- r = (dm_addmap(DM_DEVICE_RELOAD, mpp->alias, DEFAULT_TARGET,
- mpp->params, mpp->size, NULL) &&
+ r = (dm_addmap(DM_DEVICE_RELOAD, DEFAULT_TARGET, mpp, 0) &&
dm_simplecmd(DM_DEVICE_RESUME, mpp->alias));
break;

@@ -774,6 +772,9 @@
mpp->hwe = pp1->hwe;
strcpy(mpp->wwid, pp1->wwid);
select_alias(mpp);
+ select_mode(mpp);
+ select_uid(mpp);
+ select_gid(mpp);

pp1->mpp = mpp;
mpp->size = pp1->size;

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

04-14-2008 10:40 PM

multipath-tools ./multipath.conf.annotated ./m ...
 
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL4_FC5
Changes by: bmarzins@sourceware.org 2008-04-14 22:40:09

Modified files:
. : multipath.conf.annotated
multipath.conf.synthetic
libmultipath : config.c config.h dict.c propsel.c propsel.h
structs.h
multipathd : cli.c cli.h cli_handlers.c cli_handlers.h
main.c

Log message:
Fix for bz #430494. I added another multipath.conf parameter,
"flush_on_last_del" that, if set, turns off queueing when the last path for a
mutipath device is deleted. It is also possible to disable and restore queueing
via multipathd -k commands.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.annotated.diff?cvsroot=dm&only_with _tag=RHEL4_FC5&r1=1.16.2.5&r2=1.16.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.synthetic.diff?cvsroot=dm&only_with _tag=RHEL4_FC5&r1=1.10.2.2&r2=1.10.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r 1=1.17.2.3&r2=1.17.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.h.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r 1=1.17.2.3&r2=1.17.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/dict.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1= 1.16.2.4&r2=1.16.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/propsel.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5& r1=1.9.2.2&r2=1.9.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/propsel.h.diff?cvsroot=dm&only_with_tag=RHEL4_FC5& r1=1.4.2.2&r2=1.4.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/structs.h.diff?cvsroot=dm&only_with_tag=RHEL4_FC5& r1=1.17.2.7&r2=1.17.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1=1 .4&r2=1.4.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli.h.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1=1 .4&r2=1.4.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli_handlers.c.diff?cvsroot=dm&only_with_tag=RHEL4 _FC5&r1=1.4&r2=1.4.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli_handlers.h.diff?cvsroot=dm&only_with_tag=RHEL4 _FC5&r1=1.2&r2=1.2.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1= 1.66.2.3&r2=1.66.2.4

--- multipath-tools/multipath.conf.annotated 2008/04/14 22:32:03 1.16.2.5
+++ multipath-tools/multipath.conf.annotated 2008/04/14 22:40:08 1.16.2.6
@@ -140,6 +140,16 @@
# no_path_retry queue
#
# #
+# # name : flush_on_last_del
+# # scope : multipathd
+# # desc : If set to "yes", multipathd will disable queueing when the
+# # last path to a device has been deleted.
+# # values : yes|no
+# # default : no
+# #
+# flush_on_last_del yes
+#
+# #
# # name : user_friendly_names
# # scope : multipath
# # desc : If set to "yes", using the bindings file, by default
@@ -282,7 +292,17 @@
# # values : queue|fail|n (>0)
# #
# no_path_retry queue
+#
# #
+# # name : flush_on_last_del
+# # scope : multipathd
+# # desc : If set to "yes", multipathd will disable queueing
+# # when the last path to a device has been deleted.
+# # values : yes|no
+# # default : no
+# #
+# flush_on_last_del yes
+#
# # name : mode
# # scope : multipath
# # desc : The mode to use for the multipath device node,
@@ -447,6 +467,16 @@
# # values : queue|fail|n (>0)
# #
# no_path_retry queue
+#
+# #
+# # name : flush_on_last_del
+# # scope : multipathd
+# # desc : If set to "yes", multipathd will disable queueing
+# # when the last path to a device has been deleted.
+# # values : yes|no
+# # default : no
+# #
+# flush_on_last_del yes
# }
# device {
# vendor "COMPAQ "
--- multipath-tools/multipath.conf.synthetic 2008/04/14 22:32:03 1.10.2.2
+++ multipath-tools/multipath.conf.synthetic 2008/04/14 22:40:08 1.10.2.3
@@ -15,6 +15,7 @@
# rr_weight priorities
# failback immediate
# no_path_retry fail
+# flush_on_last_del no
# user_friendly_name yes
# mode 0666
# uid 0
--- multipath-tools/libmultipath/config.c 2008/04/14 22:32:04 1.17.2.3
+++ multipath-tools/libmultipath/config.c 2008/04/14 22:40:08 1.17.2.4
@@ -408,6 +408,7 @@
conf->rr_min_io = DEFAULT_RR_MIN_IO;
conf->max_fds = 0;
conf->attribute_flags = 0;
+ conf->flush_on_last_del = 0;
conf->bindings_file = DEFAULT_BINDINGS_FILE;

/*
--- multipath-tools/libmultipath/config.h 2008/04/14 22:32:04 1.17.2.3
+++ multipath-tools/libmultipath/config.h 2008/04/14 22:40:08 1.17.2.4
@@ -23,6 +23,7 @@
int rr_weight;
int no_path_retry;
int pg_timeout;
+ int flush_on_last_del;

char * vendor;
char * product;
@@ -44,6 +45,7 @@
int no_path_retry;
int pg_timeout;
int attribute_flags;
+ int flush_on_last_del;
uid_t uid;
gid_t gid;
mode_t mode;
@@ -75,6 +77,7 @@
int pg_timeout;
int max_fds;
int attribute_flags;
+ int flush_on_last_del;
uid_t uid;
gid_t gid;
mode_t mode;
--- multipath-tools/libmultipath/dict.c 2008/04/14 22:32:04 1.16.2.4
+++ multipath-tools/libmultipath/dict.c 2008/04/14 22:40:08 1.16.2.5
@@ -294,6 +294,26 @@
}

static int
+def_flush_on_last_del_handler(vector strvec)
+{
+ char * buff;
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+
+ if (!strncmp(buff, "no", 2) || !strncmp(buff, "0", 1))
+ conf->flush_on_last_del = FLUSH_DISABLED;
+ else if (!strncmp(buff, "yes", 2) || !strncmp(buff, "1", 1))
+ conf->flush_on_last_del = FLUSH_ENABLED;
+ else
+ conf->flush_on_last_del = FLUSH_UNDEF;
+
+ free(buff);
+ return 0;
+}
+
+static int
default_pg_timeout_handler(vector strvec)
{
int pg_timeout;
@@ -659,6 +679,30 @@
}

static int
+hw_flush_on_last_del_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 (!strncmp(buff, "no", 2) || !strncmp(buff, "0", 1))
+ hwe->flush_on_last_del = FLUSH_DISABLED;
+ else if (!strncmp(buff, "yes", 2) || !strncmp(buff, "1", 1))
+ hwe->flush_on_last_del = FLUSH_ENABLED;
+ else
+ hwe->flush_on_last_del = FLUSH_UNDEF;
+
+ free(buff);
+ return 0;
+}
+
+static int
hw_pg_timeout_handler(vector strvec)
{
int pg_timeout;
@@ -857,6 +901,30 @@
}

static int
+mp_flush_on_last_del_handler(vector strvec)
+{
+ struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
+ char * buff;
+
+ if (!mpe)
+ return 1;
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+
+ if (!strncmp(buff, "no", 2) || !strncmp(buff, "0", 1))
+ mpe->flush_on_last_del = FLUSH_DISABLED;
+ else if (!strncmp(buff, "yes", 2) || !strncmp(buff, "1", 1))
+ mpe->flush_on_last_del = FLUSH_ENABLED;
+ else
+ mpe->flush_on_last_del = FLUSH_UNDEF;
+
+ free(buff);
+ return 0;
+}
+
+static int
mp_mode_handler(vector strvec)
{
mode_t mode;
@@ -987,6 +1055,7 @@
install_keyword("max_fds", &max_fds_handler);
install_keyword("rr_weight", &def_weight_handler);
install_keyword("no_path_retry", &def_no_path_retry_handler);
+ install_keyword("flush_on_last_del", &def_flush_on_last_del_handler);
install_keyword("pg_timeout", &default_pg_timeout_handler);
install_keyword("user_friendly_names", &names_handler);
install_keyword("bindings_file", &bindings_file_handler);
@@ -1024,6 +1093,7 @@
install_keyword("failback", &hw_failback_handler);
install_keyword("rr_weight", &hw_weight_handler);
install_keyword("no_path_retry", &hw_no_path_retry_handler);
+ install_keyword("flush_on_last_del", &hw_flush_on_last_del_handler);
install_keyword("pg_timeout", &hw_pg_timeout_handler);
install_sublevel_end();

@@ -1037,6 +1107,7 @@
install_keyword("failback", &mp_failback_handler);
install_keyword("rr_weight", &mp_weight_handler);
install_keyword("no_path_retry", &mp_no_path_retry_handler);
+ install_keyword("flush_on_last_del", &mp_flush_on_last_del_handler);
install_keyword("pg_timeout", &mp_pg_timeout_handler);
install_keyword("mode", &mp_mode_handler);
install_keyword("uid", &mp_uid_handler);
--- multipath-tools/libmultipath/propsel.c 2008/04/14 22:32:04 1.9.2.2
+++ multipath-tools/libmultipath/propsel.c 2008/04/14 22:40:08 1.9.2.3
@@ -322,6 +322,32 @@
}

extern int
+select_flush_on_last_del(struct multipath *mp)
+{
+ if (mp->mpe && mp->mpe->flush_on_last_del != FLUSH_UNDEF) {
+ mp->flush_on_last_del = mp->mpe->flush_on_last_del;
+ condlog(3, "flush_on_last_del = %i (multipath setting)",
+ mp->flush_on_last_del);
+ return 0;
+ }
+ if (mp->hwe && mp->hwe->flush_on_last_del != FLUSH_UNDEF) {
+ mp->flush_on_last_del = mp->hwe->flush_on_last_del;
+ condlog(3, "flush_on_last_del = %i (controler setting)",
+ mp->flush_on_last_del);
+ return 0;
+ }
+ if (conf->flush_on_last_del != FLUSH_UNDEF) {
+ mp->flush_on_last_del = conf->flush_on_last_del;
+ condlog(3, "flush_on_last_del = %i (config file default)",
+ mp->flush_on_last_del);
+ return 0;
+ }
+ mp->flush_on_last_del = FLUSH_UNDEF;
+ condlog(3, "flush_on_last_del = DISABLED (internal default)");
+ return 0;
+}
+
+extern int
select_pg_timeout(struct multipath *mp)
{
if (mp->mpe && mp->mpe->pg_timeout != PGTIMEOUT_UNDEF) {
--- multipath-tools/libmultipath/propsel.h 2008/04/14 22:32:04 1.4.2.2
+++ multipath-tools/libmultipath/propsel.h 2008/04/14 22:40:08 1.4.2.3
@@ -14,3 +14,4 @@
int select_mode(struct multipath *mp);
int select_uid(struct multipath *mp);
int select_gid(struct multipath *mp);
+int select_flush_on_last_del(struct multipath *mp);
--- multipath-tools/libmultipath/structs.h 2008/04/14 22:32:04 1.17.2.7
+++ multipath-tools/libmultipath/structs.h 2008/04/14 22:40:08 1.17.2.8
@@ -71,6 +71,12 @@
ATTR_MODE,
};

+enum flush_states {
+ FLUSH_UNDEF,
+ FLUSH_DISABLED,
+ FLUSH_ENABLED,
+};
+
struct scsi_idlun {
int dev_id;
int host_unique_id;
@@ -142,6 +148,7 @@
int retry_tick; /* remaining times for retries */
int pg_timeout;
int attribute_flags;
+ int flush_on_last_del;
uid_t uid;
gid_t gid;
mode_t mode;
--- multipath-tools/multipathd/cli.c 2005/11/16 20:24:58 1.4
+++ multipath-tools/multipathd/cli.c 2008/04/14 22:40:09 1.4.2.1
@@ -124,6 +124,8 @@
r += add_key(keys, "del", DEL, 0);
r += add_key(keys, "switch", SWITCH, 0);
r += add_key(keys, "switchgroup", SWITCH, 0);
+ r += add_key(keys, "disablequeueing", DISABLEQ, 0);
+ r += add_key(keys, "restorequeueing", RESTOREQ, 0);
r += add_key(keys, "paths", PATHS, 0);
r += add_key(keys, "maps", MAPS, 0);
r += add_key(keys, "path", PATH, 1);
--- multipath-tools/multipathd/cli.h 2005/11/16 20:24:58 1.4
+++ multipath-tools/multipathd/cli.h 2008/04/14 22:40:09 1.4.2.1
@@ -3,6 +3,8 @@
__ADD,
__DEL,
__SWITCH,
+ __DISABLEQ,
+ __RESTOREQ,
__PATHS,
__MAPS,
__PATH,
@@ -17,6 +19,8 @@
#define ADD (1 << __ADD)
#define DEL (1 << __DEL)
#define SWITCH (1 << __SWITCH)
+#define DISABLEQ (1 << __DISABLEQ)
+#define RESTOREQ (1 << __RESTOREQ)
#define PATHS (1 << __PATHS)
#define MAPS (1 << __MAPS)
#define PATH (1 << __PATH)
--- multipath-tools/multipathd/cli_handlers.c 2005/12/02 08:01:09 1.4
+++ multipath-tools/multipathd/cli_handlers.c 2008/04/14 22:40:09 1.4.2.1
@@ -74,6 +74,48 @@
}

int
+cli_restore_queueing(void *v, char **reply, int *len, void *data)
+{
+ struct vectors * vecs = (struct vectors *)data;
+ char * mapname = get_keyparam(v, MAP);
+ struct multipath *mpp;
+ int minor;
+
+ if (sscanf(mapname, "dm-%d", &minor) == 1)
+ mpp = find_mp_by_minor(vecs->mpvec, minor);
+ else
+ mpp = find_mp(vecs->mpvec, mapname);
+
+ if (mpp->no_path_retry != NO_PATH_RETRY_UNDEF &&
+ mpp->no_path_retry != NO_PATH_RETRY_FAIL) {
+ dm_queue_if_no_path(mpp->alias, 1);
+ if (mpp->nr_active > 0)
+ mpp->retry_tick = 0;
+ else
+ mpp->retry_tick = mpp->no_path_retry * conf->checkint;
+ }
+ return 0;
+}
+
+int
+cli_disable_queueing(void *v, char **reply, int *len, void *data)
+{
+ struct vectors * vecs = (struct vectors *)data;
+ char * mapname = get_keyparam(v, MAP);
+ struct multipath *mpp;
+ int minor;
+
+ if (sscanf(mapname, "dm-%d", &minor) == 1)
+ mpp = find_mp_by_minor(vecs->mpvec, minor);
+ else
+ mpp = find_mp(vecs->mpvec, mapname);
+
+ mpp->retry_tick = 0;
+ dm_queue_if_no_path(mpp->alias, 0);
+ return 0;
+}
+
+int
cli_del_map (void * v, char ** reply, int * len, void * data)
{
struct vectors * vecs = (struct vectors *)data;
--- multipath-tools/multipathd/cli_handlers.h 2005/10/12 21:57:26 1.2
+++ multipath-tools/multipathd/cli_handlers.h 2008/04/14 22:40:09 1.2.2.1
@@ -7,3 +7,5 @@
int cli_switch_group(void * v, char ** reply, int * len, void * data);
int cli_dump_pathvec(void * v, char ** reply, int * len, void * data);
int cli_reconfigure(void * v, char ** reply, int * len, void * data);
+int cli_disable_queueing(void * v, char ** reply, int * len, void * data);
+int cli_restore_queueing(void * v, char ** reply, int * len, void * data);
--- multipath-tools/multipathd/main.c 2008/01/25 22:30:00 1.66.2.3
+++ multipath-tools/multipathd/main.c 2008/04/14 22:40:09 1.66.2.4
@@ -416,6 +416,7 @@
adopt_paths(vecs, mpp);
mpp->hwe = extract_hwe_from_path(mpp);
select_pgfailback(mpp);
+ select_flush_on_last_del(mpp);
set_no_path_retry(mpp);

return 0;
@@ -837,6 +838,8 @@
{
int i;
struct path * pp;
+ struct multipath * mpp;
+ int found = 0;

pp = find_path_by_dev(vecs->pathvec, devname);

@@ -844,14 +847,28 @@
condlog(3, "%s: not in pathvec", devname);
return 1;
}
+
+ mpp = pp->mpp;

- if (pp->mpp && (pp->state == PATH_UP || pp->state == PATH_GHOST))
- update_queue_mode_del_path(pp->mpp);
+ if (mpp && (pp->state == PATH_UP || pp->state == PATH_GHOST))
+ update_queue_mode_del_path(mpp);

condlog(2, "remove %s path checker", devname);
i = find_slot(vecs->pathvec, (void *)pp);
vector_del_slot(vecs->pathvec, i);
free_path(pp);
+ vector_foreach_slot (vecs->pathvec, pp, i) {
+ if (pp->mpp == mpp){
+ found = 1;
+ break;
+ }
+ }
+ if (!found && mpp->flush_on_last_del == FLUSH_ENABLED) {
+ condlog(1, "%s: Last path deleted, disabling queueing",
+ mpp->alias);
+ mpp->retry_tick = 0;
+ dm_queue_if_no_path(mpp->alias, 0);
+ }

return 0;
}
@@ -1166,6 +1183,8 @@
add_handler(SWITCH+MAP+GROUP, cli_switch_group);
add_handler(DUMP+PATHVEC, cli_dump_pathvec);
add_handler(RECONFIGURE, cli_reconfigure);
+ add_handler(DISABLEQ+MAP, cli_disable_queueing);
+ add_handler(RESTOREQ+MAP, cli_restore_queueing);

uxsock_listen(&uxsock_trigger, ap);


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

08-25-2008 08:59 PM

multipath-tools ./multipath.conf.annotated ./m ...
 
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2008-08-25 20:59:06

Modified files:
. : multipath.conf.annotated
multipath.conf.synthetic
kpartx : devmapper.c devmapper.h kpartx.c
libmultipath : config.c config.h configure.c devmapper.c
devmapper.h dict.c propsel.c propsel.h
structs.h structs_vec.c

Log message:
Fix for bz #431843. Added three new parameters to /etc/multipath.conf:
mode, uid, and gid. These can be used to override the default values when
multipath device nodes are created. Unfortunately, you cannot do name
resolution with static binaries, since you must load libnss dynamically, so
uid and gid must use the numerical user id and group id.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.annotated.diff?cvsroot=dm&only_with _tag=RHEL5_FC6&r1=1.18.2.5&r2=1.18.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.synthetic.diff?cvsroot=dm&only_with _tag=RHEL5_FC6&r1=1.11.2.3&r2=1.11.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/kpartx/devmapper.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC 6&r1=1.8&r2=1.8.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/kpartx/devmapper.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC 6&r1=1.5&r2=1.5.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/kpartx/kpartx.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r 1=1.9&r2=1.9.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r 1=1.19.2.5&r2=1.19.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r 1=1.18.2.4&r2=1.18.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/configure.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC 6&r1=1.2.2.2&r2=1.2.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/devmapper.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC 6&r1=1.22.2.4&r2=1.22.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/devmapper.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC 6&r1=1.11.2.2&r2=1.11.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/dict.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1= 1.17.2.4&r2=1.17.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/propsel.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6& r1=1.11&r2=1.11.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/propsel.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6& r1=1.5&r2=1.5.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/structs.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6& r1=1.18.2.2&r2=1.18.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/structs_vec.c.diff?cvsroot=dm&only_with_tag=RHEL5_ FC6&r1=1.1.2.1&r2=1.1.2.2

--- multipath-tools/multipath.conf.annotated 2008/01/15 01:34:36 1.18.2.5
+++ multipath-tools/multipath.conf.annotated 2008/08/25 20:59:05 1.18.2.6
@@ -143,6 +143,33 @@
# # default : "/var/lib/multipath/bindings"
# bindings_file "/etc/multipath_bindings"
#
+# #
+# # name : mode
+# # scope : multipath
+# # desc : The mode to use for the multipath device nodes, in octal.
+# # values : 0000 - 0777
+# # default : determined by the process
+# mode 0644
+#
+# #
+# # name : uid
+# # scope : multipath
+# # desc : The user id to use for the multipath device nodes. You
+# # must use the numeric user id.
+# # values : <user_id_number>
+# # default : determined by the process
+# uid 0
+#
+# #
+# # name : gid
+# # scope : multipath
+# # desc : The group id to use for the multipath device nodes. You
+# # must use the numeric group id.
+# # values : <group_id_number>
+# # default : determined by the process
+# gid 0
+#
+
#}
#
##
@@ -264,6 +291,34 @@
# # default : 1000
# #
# rr_min_io 100
+#
+# #
+# # name : mode
+# # scope : multipath
+# # desc : The mode to use for the multipath device node,
+# # in octal.
+# # values : 0000 - 0777
+# # default : determined by the process
+# mode 0644
+#
+# #
+# # name : uid
+# # scope : multipath
+# # desc : The user id to use for the multipath device node.
+# # You must use the numeric user id.
+# # values : <user_id_number>
+# # default : determined by the process
+# uid 0
+#
+# #
+# # name : gid
+# # scope : multipath
+# # desc : The group id to use for the multipath device node.
+# # You must use the numeric group id.
+# # values : <group_id_number>
+# # default : determined by the process
+# gid 0
+#
# }
# multipath {
# wwid 1DEC_____321816758474
--- multipath-tools/multipath.conf.synthetic 2008/01/15 01:34:36 1.11.2.3
+++ multipath-tools/multipath.conf.synthetic 2008/08/25 20:59:05 1.11.2.4
@@ -16,6 +16,9 @@
# failback immediate
# no_path_retry fail
# user_friendly_names no
+# mode 0666
+# uid 0
+# gid 0
#}
#blacklist {
# wwid 26353900f02796769
--- multipath-tools/kpartx/devmapper.c 2006/10/13 23:28:47 1.8
+++ multipath-tools/kpartx/devmapper.c 2008/08/25 20:59:06 1.8.2.1
@@ -74,7 +74,8 @@

extern int
dm_addmap (int task, const char *name, const char *target,
- const char *params, uint64_t size, const char *uuid, int part) {
+ const char *params, uint64_t size, const char *uuid, int part,
+ mode_t mode, uid_t uid, gid_t gid) {
int r = 0;
struct dm_task *dmt;
char *prefixed_uuid = NULL;
@@ -100,6 +101,13 @@
goto freeout;
}

+ if (!dm_task_set_mode(dmt, mode))
+ goto freeout;
+ if (!dm_task_set_uid(dmt, uid))
+ goto freeout;
+ if (!dm_task_set_gid(dmt, gid))
+ goto freeout;
+
dm_task_no_open_count(dmt);

r = dm_task_run (dmt);
--- multipath-tools/kpartx/devmapper.h 2006/10/13 23:28:47 1.5
+++ multipath-tools/kpartx/devmapper.h 2008/08/25 20:59:06 1.5.2.1
@@ -3,7 +3,7 @@
int dm_prereq (char *, int, int, int);
int dm_simplecmd (int, const char *);
int dm_addmap (int, const char *, const char *, const char *, uint64_t,
- const char *, int);
+ const char *, int, mode_t, uid_t, gid_t);
int dm_map_present (char *);
char * dm_mapname(int major, int minor);
dev_t dm_get_first_dep(char *devname);
--- multipath-tools/kpartx/kpartx.c 2006/10/13 23:28:47 1.9
+++ multipath-tools/kpartx/kpartx.c 2008/08/25 20:59:06 1.9.2.1
@@ -424,7 +424,9 @@
DM_DEVICE_RELOAD : DM_DEVICE_CREATE);

dm_addmap(op, partname, DM_TARGET, params,
- slices[j].size, uuid, j+1);
+ slices[j].size, uuid, j+1,
+ buf.st_mode & 0777, buf.st_uid,
+ buf.st_gid);

if (op == DM_DEVICE_RELOAD)
dm_simplecmd(DM_DEVICE_RESUME,
--- multipath-tools/libmultipath/config.c 2008/01/15 01:34:36 1.19.2.5
+++ multipath-tools/libmultipath/config.c 2008/08/25 20:59:06 1.19.2.6
@@ -412,6 +412,7 @@
conf->dev_type = DEV_NONE;
conf->minio = 1000;
conf->max_fds = 0;
+ conf->attribute_flags = 0;

/*
* read the config file
--- multipath-tools/libmultipath/config.h 2008/08/22 21:55:43 1.18.2.4
+++ multipath-tools/libmultipath/config.h 2008/08/25 20:59:06 1.18.2.5
@@ -1,6 +1,8 @@
#ifndef _CONFIG_H
#define _CONFIG_H

+#include <sys/types.h>
+
#define ORIGIN_DEFAULT 0
#define ORIGIN_CONFIG 1

@@ -43,6 +45,10 @@
int no_path_retry;
int minio;
int pg_timeout;
+ int attribute_flags;
+ uid_t uid;
+ gid_t gid;
+ mode_t mode;
};

struct config {
@@ -65,6 +71,10 @@
int pg_timeout;
int max_fds;
int force_reload;
+ int attribute_flags;
+ uid_t uid;
+ gid_t gid;
+ mode_t mode;

char * dev;
char * udev_dir;
--- multipath-tools/libmultipath/configure.c 2008/08/22 21:55:43 1.2.2.2
+++ multipath-tools/libmultipath/configure.c 2008/08/25 20:59:06 1.2.2.3
@@ -18,7 +18,6 @@

#include "vector.h"
#include "memory.h"
-#include "devmapper.h"
#include "defaults.h"
#include "structs.h"
#include "structs_vec.h"
@@ -34,6 +33,7 @@
#include "pgpolicies.h"
#include "dict.h"
#include "alias.h"
+#include "devmapper.h"

extern int
setup_map (struct multipath * mpp)
@@ -334,13 +334,11 @@
if (dm_map_present(mpp->alias))
break;

- r = dm_addmap(DM_DEVICE_CREATE, mpp->alias, DEFAULT_TARGET,
- mpp->params, mpp->size, mpp->wwid, 0);
+ r = dm_addmap(DM_DEVICE_CREATE, DEFAULT_TARGET, mpp, 1, 0);

if (!r)
- r = dm_addmap(DM_DEVICE_CREATE, mpp->alias,
- DEFAULT_TARGET, mpp->params, mpp->size,
- mpp->wwid, 1);
+ r = dm_addmap(DM_DEVICE_CREATE, DEFAULT_TARGET, mpp, 1,
+ 1);
/*
* DM_DEVICE_CREATE is actually DM_DEV_CREATE plus
* DM_TABLE_LOAD. Failing the second part leaves an
@@ -357,12 +355,10 @@
break;

case ACT_RELOAD:
- r = dm_addmap(DM_DEVICE_RELOAD, mpp->alias, DEFAULT_TARGET,
- mpp->params, mpp->size, NULL, 0);
+ r = dm_addmap(DM_DEVICE_RELOAD, DEFAULT_TARGET, mpp, 0, 0);
if (!r)
- r = dm_addmap(DM_DEVICE_RELOAD, mpp->alias,
- DEFAULT_TARGET, mpp->params, mpp->size,
- NULL, 1);
+ r = dm_addmap(DM_DEVICE_RELOAD, DEFAULT_TARGET, mpp, 0,
+ 1);
if (r)
r = dm_simplecmd(DM_DEVICE_RESUME, mpp->alias);
break;
--- multipath-tools/libmultipath/devmapper.c 2008/08/22 21:55:43 1.22.2.4
+++ multipath-tools/libmultipath/devmapper.c 2008/08/25 20:59:06 1.22.2.5
@@ -152,44 +152,53 @@
}

extern int
-dm_addmap (int task, const char *name, const char *target,
- const char *params, unsigned long long size, const char *uuid,
+dm_addmap (int task, const char *target, struct multipath *mpp, int use_wwid,
int ro) {
int r = 0;
struct dm_task *dmt;
- char *prefixed_uuid = NULL;
+ char *prefixed_wwid = NULL;

if (!(dmt = dm_task_create (task)))
return 0;

- if (!dm_task_set_name (dmt, name))
+ if (!dm_task_set_name (dmt, mpp->alias))
goto addout;

- if (!dm_task_add_target (dmt, 0, size, target, params))
+ if (!dm_task_add_target (dmt, 0, mpp->size, target, mpp->params))
goto addout;

if (ro)
dm_task_set_ro(dmt);

- if (uuid){
- prefixed_uuid = MALLOC(UUID_PREFIX_LEN + strlen(uuid) + 1);
- if (!prefixed_uuid) {
+ if (use_wwid && mpp->wwid){
+ prefixed_wwid = MALLOC(UUID_PREFIX_LEN + strlen(mpp->wwid) + 1);
+ if (!prefixed_wwid) {
condlog(0, "cannot create prefixed uuid : %s
",
strerror(errno));
goto addout;
}
- sprintf(prefixed_uuid, UUID_PREFIX "%s", uuid);
- if (!dm_task_set_uuid(dmt, prefixed_uuid))
+ sprintf(prefixed_wwid, UUID_PREFIX "%s", mpp->wwid);
+ if (!dm_task_set_uuid(dmt, prefixed_wwid))
goto freeout;
}

+ if (mpp->attribute_flags & (1 << ATTR_MODE) &&
+ !dm_task_set_mode(dmt, mpp->mode))
+ goto freeout;
+ if (mpp->attribute_flags & (1 << ATTR_UID) &&
+ !dm_task_set_uid(dmt, mpp->uid))
+ goto freeout;
+ if (mpp->attribute_flags & (1 << ATTR_GID) &&
+ !dm_task_set_gid(dmt, mpp->gid))
+ goto freeout;
+
dm_task_no_open_count(dmt);

r = dm_task_run (dmt);

freeout:
- if (prefixed_uuid)
- free(prefixed_uuid);
+ if (prefixed_wwid)
+ free(prefixed_wwid);

addout:
dm_task_destroy (dmt);
--- multipath-tools/libmultipath/devmapper.h 2008/08/22 21:55:43 1.11.2.2
+++ multipath-tools/libmultipath/devmapper.h 2008/08/25 20:59:06 1.11.2.3
@@ -1,8 +1,7 @@
void dm_init(void);
int dm_prereq (char *, int, int, int);
int dm_simplecmd (int, const char *);
-int dm_addmap (int, const char *, const char *, const char *,
- unsigned long long, const char *uuid, int);
+int dm_addmap (int, const char *, struct multipath *, int, int);
int dm_map_present (char *);
int dm_get_map(char *, unsigned long long *, char *);
int dm_get_status(char *, char *);
--- multipath-tools/libmultipath/dict.c 2008/01/15 01:34:36 1.17.2.4
+++ multipath-tools/libmultipath/dict.c 2008/08/25 20:59:06 1.17.2.5
@@ -5,6 +5,8 @@
* Copyright (c) 2005 Kiyoshi Ueda, NEC
*/
#include <checkers.h>
+#include <sys/types.h>
+#include <pwd.h>

#include "vector.h"
#include "hwtable.h"
@@ -163,6 +165,79 @@
}

static int
+def_mode_handler(vector strvec)
+{
+ mode_t mode;
+ char *buff;
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+
+ if (sscanf(buff, "%o", &mode) == 1 && mode <= 0777){
+ conf->attribute_flags |= (1 << ATTR_MODE);
+ conf->mode = mode;
+ }
+
+ FREE(buff);
+ return 0;
+}
+
+static int
+def_uid_handler(vector strvec)
+{
+ uid_t uid;
+ char *buff;
+ /*
+ char passwd_buf[1024];
+ struct passwd info, *found;
+ */
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+ /* Can't do this for statically linked binaries, because libnss
+ must be dynamically loaded. When we can use dynamically link
+ binaries in the initramfs, we can put this back */
+ /*if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
+ conf->attribute_flags |= (1 << ATTR_UID);
+ conf->uid = info.pw_uid;
+ }
+ else */if (sscanf(buff, "%u", &uid) == 1){
+ conf->attribute_flags |= (1 << ATTR_UID);
+ conf->uid = uid;
+ }
+ FREE(buff);
+ return 0;
+}
+
+static int
+def_gid_handler(vector strvec)
+{
+ gid_t gid;
+ char *buff;
+ /*
+ char passwd_buf[1024];
+ struct passwd info, *found;
+ */
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+
+ /*if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
+ conf->attribute_flags |= (1 << ATTR_GID);
+ conf->gid = info.pw_gid;
+ }
+ else */if (sscanf(buff, "%u", &gid) == 1){
+ conf->attribute_flags |= (1 << ATTR_GID);
+ conf->gid = gid;
+ }
+ FREE(buff);
+ return 0;
+}
+
+static int
def_weight_handler(vector strvec)
{
char * buff;
@@ -938,6 +1013,88 @@
}

static int
+mp_mode_handler(vector strvec)
+{
+ mode_t mode;
+ struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
+ char *buff;
+
+ if (!mpe)
+ return 1;
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+ if (sscanf(buff, "%o", &mode) == 1 && mode <= 0777){
+ mpe->attribute_flags |= (1 << ATTR_MODE);
+ mpe->mode = mode;
+ }
+
+ FREE(buff);
+ return 0;
+}
+
+static int
+mp_uid_handler(vector strvec)
+{
+ uid_t uid;
+ char *buff;
+ /*
+ char passwd_buf[1024];
+ struct passwd info, *found;
+ */
+ struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
+
+ if (!mpe)
+ return 1;
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+
+ /*if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
+ mpe->attribute_flags |= (1 << ATTR_UID);
+ mpe->uid = info.pw_uid;
+ }
+ else */if (sscanf(buff, "%u", &uid) == 1){
+ mpe->attribute_flags |= (1 << ATTR_UID);
+ mpe->uid = uid;
+ }
+ FREE(buff);
+ return 0;
+}
+
+static int
+mp_gid_handler(vector strvec)
+{
+ gid_t gid;
+ char *buff;
+ /*
+ char passwd_buf[1024];
+ struct passwd info, *found;
+ */
+ struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
+
+ if (!mpe)
+ return 1;
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+
+ /*if (getpwnam_r(buff, &info, passwd_buf, 1024, &found) == 0 && found) {
+ mpe->attribute_flags |= (1 << ATTR_GID);
+ mpe->gid = info.pw_gid;
+ }
+ else */if (sscanf(buff, "%u", &gid) == 1){
+ mpe->attribute_flags |= (1 << ATTR_GID);
+ mpe->gid = gid;
+ }
+ FREE(buff);
+ return 0;
+}
+
+static int
mp_pg_timeout_handler(vector strvec)
{
int pg_timeout;
@@ -1018,6 +1175,36 @@
}

static int
+snprint_mp_mode(char * buff, int len, void * data)
+{
+ struct mpentry * mpe = (struct mpentry *)data;
+
+ if ((mpe->attribute_flags & (1 << ATTR_MODE)) == 0)
+ return 0;
+ return snprintf(buff, len, "0%o", mpe->mode);
+}
+
+static int
+snprint_mp_uid(char * buff, int len, void * data)
+{
+ struct mpentry * mpe = (struct mpentry *)data;
+
+ if ((mpe->attribute_flags & (1 << ATTR_UID)) == 0)
+ return 0;
+ return snprintf(buff, len, "%u", mpe->uid);
+}
+
+static int
+snprint_mp_gid(char * buff, int len, void * data)
+{
+ struct mpentry * mpe = (struct mpentry *)data;
+
+ if ((mpe->attribute_flags & (1 << ATTR_GID)) == 0)
+ return 0;
+ return snprintf(buff, len, "%u", mpe->gid);
+}
+
+static int
snprint_mp_failback (char * buff, int len, void * data)
{
struct mpentry * mpe = (struct mpentry *)data;
@@ -1472,6 +1659,30 @@
}

static int
+snprint_def_mode(char * buff, int len, void * data)
+{
+ if ((conf->attribute_flags & (1 << ATTR_MODE)) == 0)
+ return 0;
+ return snprintf(buff, len, "0%o", conf->mode);
+}
+
+static int
+snprint_def_uid(char * buff, int len, void * data)
+{
+ if ((conf->attribute_flags & (1 << ATTR_UID)) == 0)
+ return 0;
+ return snprintf(buff, len, "%u", conf->uid);
+}
+
+static int
+snprint_def_gid(char * buff, int len, void * data)
+{
+ if ((conf->attribute_flags & (1 << ATTR_GID)) == 0)
+ return 0;
+ return snprintf(buff, len, "%u", conf->gid);
+}
+
+static int
snprint_def_rr_weight (char * buff, int len, void * data)
{
if (!conf->rr_weight)
@@ -1590,6 +1801,9 @@
install_keyword("pg_timeout", &def_pg_timeout_handler, &snprint_def_pg_timeout);
install_keyword("user_friendly_names", &names_handler, &snprint_def_user_friendly_names);
install_keyword("bindings_file", &bindings_file_handler, &snprint_def_bindings_file);
+ install_keyword("mode", &def_mode_handler, &snprint_def_mode);
+ install_keyword("uid", &def_uid_handler, &snprint_def_uid);
+ install_keyword("gid", &def_gid_handler, &snprint_def_gid);
__deprecated install_keyword("default_selector", &def_selector_handler, NULL);
__deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL);
__deprecated install_keyword("default_getuid_callout", &def_getuid_callout_handler, NULL);
@@ -1657,5 +1871,8 @@
install_keyword("no_path_retry", &mp_no_path_retry_handler, &snprint_mp_no_path_retry);
install_keyword("rr_min_io", &mp_minio_handler, &snprint_mp_rr_min_io);
install_keyword("pg_timeout", &mp_pg_timeout_handler, &snprint_mp_pg_timeout);
+ install_keyword("mode", &mp_mode_handler, &snprint_mp_mode);
+ install_keyword("uid", &mp_uid_handler, &snprint_mp_uid);
+ install_keyword("gid", &mp_gid_handler, &snprint_mp_gid);
install_sublevel_end();
}
--- multipath-tools/libmultipath/propsel.c 2006/08/02 21:37:22 1.11
+++ multipath-tools/libmultipath/propsel.c 2008/08/25 20:59:06 1.11.2.1
@@ -331,6 +331,60 @@
}

extern int
+select_mode (struct multipath *mp)
+{
+ if (mp->mpe && (mp->mpe->attribute_flags & (1 << ATTR_MODE))) {
+ mp->attribute_flags |= (1 << ATTR_MODE);
+ mp->mode = mp->mpe->mode;
+ condlog(3, "mode = 0%o (multipath setting)", mp->mode);
+ }
+ else if (conf->attribute_flags & (1 << ATTR_MODE)) {
+ mp->attribute_flags |= (1 << ATTR_MODE);
+ mp->mode = conf->mode;
+ condlog(3, "mode = 0%o (config file default)", mp->mode);
+ }
+ else
+ mp->attribute_flags &= ~(1 << ATTR_MODE);
+ return 0;
+}
+
+extern int
+select_uid (struct multipath *mp)
+{
+ if (mp->mpe && (mp->mpe->attribute_flags & (1 << ATTR_UID))) {
+ mp->attribute_flags |= (1 << ATTR_UID);
+ mp->uid = mp->mpe->uid;
+ condlog(3, "uid = %u (multipath setting)", mp->uid);
+ }
+ else if (conf->attribute_flags & (1 << ATTR_UID)) {
+ mp->attribute_flags |= (1 << ATTR_UID);
+ mp->uid = conf->uid;
+ condlog(3, "uid = %u (config file default)", mp->uid);
+ }
+ else
+ mp->attribute_flags &= ~(1 << ATTR_UID);
+ return 0;
+}
+
+extern int
+select_gid (struct multipath *mp)
+{
+ if (mp->mpe && (mp->mpe->attribute_flags & (1 << ATTR_GID))) {
+ mp->attribute_flags |= (1 << ATTR_GID);
+ mp->gid = mp->mpe->gid;
+ condlog(3, "gid = %u (multipath setting)", mp->gid);
+ }
+ else if (conf->attribute_flags & (1 << ATTR_GID)) {
+ mp->attribute_flags |= (1 << ATTR_GID);
+ mp->gid = conf->gid;
+ condlog(3, "gid = %u (config file default)", mp->gid);
+ }
+ else
+ mp->attribute_flags &= ~(1 << ATTR_GID);
+ return 0;
+}
+
+extern int
select_pg_timeout(struct multipath *mp)
{
if (mp->mpe && mp->mpe->pg_timeout != PGTIMEOUT_UNDEF) {
--- multipath-tools/libmultipath/propsel.h 2006/06/06 18:32:43 1.5
+++ multipath-tools/libmultipath/propsel.h 2008/08/25 20:59:06 1.5.2.1
@@ -11,3 +11,6 @@
int select_no_path_retry(struct multipath *mp);
int select_pg_timeout(struct multipath *mp);
int select_minio(struct multipath *mp);
+int select_mode(struct multipath *mp);
+int select_uid(struct multipath *mp);
+int select_gid(struct multipath *mp);
--- multipath-tools/libmultipath/structs.h 2008/01/15 01:34:36 1.18.2.2
+++ multipath-tools/libmultipath/structs.h 2008/08/25 20:59:06 1.18.2.3
@@ -1,6 +1,8 @@
#ifndef _STRUCTS_H
#define _STRUCTS_H

+#include <sys/types.h>
+
#define WWID_SIZE 128
#define SERIAL_SIZE 64
#define NODE_NAME_SIZE 19
@@ -63,6 +65,12 @@
PGTIMEOUT_NONE
};

+enum attribute_bits {
+ ATTR_UID,
+ ATTR_GID,
+ ATTR_MODE,
+};
+
struct scsi_idlun {
int dev_id;
int host_unique_id;
@@ -136,6 +144,11 @@
int retry_tick; /* remaining times for retries */
int minio;
int pg_timeout;
+ int attribute_flags;
+ uid_t uid;
+ gid_t gid;
+ mode_t mode;
+
unsigned long long size;
vector paths;
vector pg;
--- multipath-tools/libmultipath/structs_vec.c 2007/06/15 19:03:02 1.1.2.1
+++ multipath-tools/libmultipath/structs_vec.c 2008/08/25 20:59:06 1.1.2.2
@@ -343,6 +343,9 @@

strcpy(mpp->wwid, pp->wwid);
select_alias(mpp);
+ select_mode(mpp);
+ select_uid(mpp);
+ select_gid(mpp);
mpp->size = pp->size;

if (adopt_paths(vecs->pathvec, mpp))

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

09-04-2008 08:09 PM

multipath-tools ./multipath.conf.annotated ./m ...
 
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2008-09-04 20:09:48

Modified files:
. : multipath.conf.annotated
multipath.conf.synthetic
libmultipath : config.c config.h dict.c propsel.c propsel.h
structs.h structs_vec.c
multipathd : cli.c cli.h cli_handlers.c cli_handlers.h
main.c

Log message:
Fix fox bz #238421. You can now set flush_on_last_del in /etc/multipath.conf,
which turns off queue_if_no_path when the last path is deleted from a multipath map. You can also manually disable and restore queueing with the multipathd
interactive disablequeueing and restorequeueing commands.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.annotated.diff?cvsroot=dm&only_with _tag=RHEL5_FC6&r1=1.18.2.7&r2=1.18.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.synthetic.diff?cvsroot=dm&only_with _tag=RHEL5_FC6&r1=1.11.2.4&r2=1.11.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r 1=1.19.2.6&r2=1.19.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r 1=1.18.2.5&r2=1.18.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/dict.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1= 1.17.2.6&r2=1.17.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/propsel.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6& r1=1.11.2.1&r2=1.11.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/propsel.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6& r1=1.5.2.1&r2=1.5.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/structs.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6& r1=1.18.2.4&r2=1.18.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/structs_vec.c.diff?cvsroot=dm&only_with_tag=RHEL5_ FC6&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1 .5.2.1&r2=1.5.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1 .5.2.1&r2=1.5.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli_handlers.c.diff?cvsroot=dm&only_with_tag=RHEL5 _FC6&r1=1.6.2.1&r2=1.6.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/cli_handlers.h.diff?cvsroot=dm&only_with_tag=RHEL5 _FC6&r1=1.3.2.1&r2=1.3.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1= 1.69.2.9&r2=1.69.2.10

--- multipath-tools/multipath.conf.annotated 2008/08/29 21:30:34 1.18.2.7
+++ multipath-tools/multipath.conf.annotated 2008/09/04 20:09:48 1.18.2.8
@@ -121,6 +121,15 @@
# #
# #no_path_retry queue
#
+# # name : flush_on_last_del
+# # scope : multipathd
+# # desc : If set to "yes", multipathd will disable queueing when the
+# # last path to a device has been deleted.
+# # values : yes|no
+# # default : no
+# #
+# flush_on_last_del yes
+#
# #
# # name : user_friendly_names
# # scope : multipath
@@ -284,6 +293,16 @@
# #no_path_retry queue
#
# #
+# # name : flush_on_last_del
+# # scope : multipathd
+# # desc : If set to "yes", multipathd will disable queueing
+# # when the last path to a device has been deleted.
+# # values : yes|no
+# # default : no
+# #
+# flush_on_last_del yes
+#
+# #
# # name : rr_min_io
# # scope : multipath
# # desc : the number of IO to route to a path before switching
@@ -422,6 +441,16 @@
# rr_min_io 100
#
# #
+# # name : flush_on_last_del
+# # scope : multipathd
+# # desc : If set to "yes", multipathd will disable queueing
+# # when the last path to a device has been deleted.
+# # values : yes|no
+# # default : no
+# #
+# flush_on_last_del yes
+#
+# #
# # name : product_blacklist
# # scope : multipath & multipathd
# # desc : product strings to blacklist for this vendor
--- multipath-tools/multipath.conf.synthetic 2008/08/25 20:59:05 1.11.2.4
+++ multipath-tools/multipath.conf.synthetic 2008/09/04 20:09:48 1.11.2.5
@@ -16,6 +16,7 @@
# failback immediate
# no_path_retry fail
# user_friendly_names no
+# flush_on_last_del no
# mode 0666
# uid 0
# gid 0
--- multipath-tools/libmultipath/config.c 2008/08/25 20:59:06 1.19.2.6
+++ multipath-tools/libmultipath/config.c 2008/09/04 20:09:48 1.19.2.7
@@ -413,6 +413,7 @@
conf->minio = 1000;
conf->max_fds = 0;
conf->attribute_flags = 0;
+ conf->flush_on_last_del = 0;

/*
* read the config file
--- multipath-tools/libmultipath/config.h 2008/08/25 20:59:06 1.18.2.5
+++ multipath-tools/libmultipath/config.h 2008/09/04 20:09:48 1.18.2.6
@@ -29,6 +29,7 @@
int no_path_retry;
int minio;
int pg_timeout;
+ int flush_on_last_del;
struct checker * checker;
char * bl_product;
};
@@ -46,6 +47,7 @@
int minio;
int pg_timeout;
int attribute_flags;
+ int flush_on_last_del;
uid_t uid;
gid_t gid;
mode_t mode;
@@ -72,6 +74,7 @@
int max_fds;
int force_reload;
int attribute_flags;
+ int flush_on_last_del;
uid_t uid;
gid_t gid;
mode_t mode;
--- multipath-tools/libmultipath/dict.c 2008/08/29 21:30:34 1.17.2.6
+++ multipath-tools/libmultipath/dict.c 2008/09/04 20:09:48 1.17.2.7
@@ -297,6 +297,26 @@
}

static int
+def_flush_on_last_del_handler(vector strvec)
+{
+ char * buff;
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+
+ if (!strncmp(buff, "no", 2) || !strncmp(buff, "0", 1))
+ conf->flush_on_last_del = FLUSH_DISABLED;
+ else if (!strncmp(buff, "yes", 2) || !strncmp(buff, "1", 1))
+ conf->flush_on_last_del = FLUSH_ENABLED;
+ else
+ conf->flush_on_last_del = FLUSH_UNDEF;
+
+ free(buff);
+ return 0;
+}
+
+static int
def_pg_timeout_handler(vector strvec)
{
int pg_timeout;
@@ -791,6 +811,30 @@
}

static int
+hw_flush_on_last_del_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 (!strncmp(buff, "no", 2) || !strncmp(buff, "0", 1))
+ hwe->flush_on_last_del = FLUSH_DISABLED;
+ else if (!strncmp(buff, "yes", 2) || !strncmp(buff, "1", 1))
+ hwe->flush_on_last_del = FLUSH_ENABLED;
+ else
+ hwe->flush_on_last_del = FLUSH_UNDEF;
+
+ free(buff);
+ return 0;
+}
+
+static int
hw_pg_timeout_handler(vector strvec)
{
int pg_timeout;
@@ -1013,6 +1057,30 @@
}

static int
+mp_flush_on_last_del_handler(vector strvec)
+{
+ struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
+ char * buff;
+
+ if (!mpe)
+ return 1;
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+
+ if (!strncmp(buff, "no", 2) || !strncmp(buff, "0", 1))
+ mpe->flush_on_last_del = FLUSH_DISABLED;
+ else if (!strncmp(buff, "yes", 2) || !strncmp(buff, "1", 1))
+ mpe->flush_on_last_del = FLUSH_ENABLED;
+ else
+ mpe->flush_on_last_del = FLUSH_UNDEF;
+
+ free(buff);
+ return 0;
+}
+
+static int
mp_mode_handler(vector strvec)
{
mode_t mode;
@@ -1272,6 +1340,20 @@
}

static int
+snprint_mp_flush_on_last_del (char * buff, int len, void * data)
+{
+ struct mpentry * mpe = (struct mpentry *)data;
+
+ switch (mpe->flush_on_last_del) {
+ case FLUSH_DISABLED:
+ return snprintf(buff, len, "no");
+ case FLUSH_ENABLED:
+ return snprintf(buff, len, "yes");
+ }
+ return 0;
+}
+
+static int
snprint_mp_pg_timeout (char * buff, int len, void * data)
{
struct mpentry * mpe = (struct mpentry *)data;
@@ -1489,6 +1571,20 @@
}

static int
+snprint_hw_flush_on_last_del (char * buff, int len, void * data)
+{
+ struct hwentry * hwe = (struct hwentry *)data;
+
+ switch (hwe->flush_on_last_del) {
+ case FLUSH_DISABLED:
+ return snprintf(buff, len, "no");
+ case FLUSH_ENABLED:
+ return snprintf(buff, len, "yes");
+ }
+ return 0;
+}
+
+static int
snprint_hw_pg_timeout (char * buff, int len, void * data)
{
struct hwentry * hwe = (struct hwentry *)data;
@@ -1716,6 +1812,18 @@
}

static int
+snprint_def_flush_on_last_del (char * buff, int len, void * data)
+{
+ switch (conf->flush_on_last_del) {
+ case FLUSH_DISABLED:
+ return snprintf(buff, len, "no");
+ case FLUSH_ENABLED:
+ return snprintf(buff, len, "yes");
+ }
+ return 0;
+}
+
+static int
snprint_def_pg_timeout (char * buff, int len, void * data)
{
if (conf->pg_timeout == DEFAULT_PGTIMEOUT)
@@ -1798,6 +1906,7 @@
install_keyword("max_fds", &max_fds_handler, &snprint_max_fds);
install_keyword("rr_weight", &def_weight_handler, &snprint_def_rr_weight);
install_keyword("no_path_retry", &def_no_path_retry_handler, &snprint_def_no_path_retry);
+ install_keyword("flush_on_last_del", &def_flush_on_last_del_handler, &snprint_def_flush_on_last_del);
install_keyword("pg_timeout", &def_pg_timeout_handler, &snprint_def_pg_timeout);
install_keyword("user_friendly_names", &names_handler, &snprint_def_user_friendly_names);
install_keyword("bindings_file", &bindings_file_handler, &snprint_def_bindings_file);
@@ -1856,6 +1965,7 @@
install_keyword("rr_weight", &hw_weight_handler, &snprint_hw_rr_weight);
install_keyword("no_path_retry", &hw_no_path_retry_handler, &snprint_hw_no_path_retry);
install_keyword("rr_min_io", &hw_minio_handler, &snprint_hw_rr_min_io);
+ install_keyword("flush_on_last_del", &hw_flush_on_last_del_handler, &snprint_hw_flush_on_last_del);
install_keyword("pg_timeout", &hw_pg_timeout_handler, &snprint_hw_pg_timeout);
install_sublevel_end();

@@ -1870,6 +1980,7 @@
install_keyword("rr_weight", &mp_weight_handler, &snprint_mp_rr_weight);
install_keyword("no_path_retry", &mp_no_path_retry_handler, &snprint_mp_no_path_retry);
install_keyword("rr_min_io", &mp_minio_handler, &snprint_mp_rr_min_io);
+ install_keyword("flush_on_last_del", &mp_flush_on_last_del_handler, &snprint_mp_flush_on_last_del);
install_keyword("pg_timeout", &mp_pg_timeout_handler, &snprint_mp_pg_timeout);
install_keyword("mode", &mp_mode_handler, &snprint_mp_mode);
install_keyword("uid", &mp_uid_handler, &snprint_mp_uid);
--- multipath-tools/libmultipath/propsel.c 2008/08/25 20:59:06 1.11.2.1
+++ multipath-tools/libmultipath/propsel.c 2008/09/04 20:09:48 1.11.2.2
@@ -279,6 +279,10 @@
extern int
select_no_path_retry(struct multipath *mp)
{
+ if (mp->flush_on_last_del == FLUSH_IN_PROGRESS) {
+ condlog(0, "flush_on_last_del in progress");
+ mp->no_path_retry = NO_PATH_RETRY_FAIL;
+ }
if (mp->mpe && mp->mpe->no_path_retry != NO_PATH_RETRY_UNDEF) {
mp->no_path_retry = mp->mpe->no_path_retry;
condlog(3, "%s: no_path_retry = %i (multipath setting)",
@@ -385,6 +389,34 @@
}

extern int
+select_flush_on_last_del(struct multipath *mp)
+{
+ if (mp->flush_on_last_del == FLUSH_IN_PROGRESS)
+ return 0;
+ if (mp->mpe && mp->mpe->flush_on_last_del != FLUSH_UNDEF) {
+ mp->flush_on_last_del = mp->mpe->flush_on_last_del;
+ condlog(3, "flush_on_last_del = %i (multipath setting)",
+ mp->flush_on_last_del);
+ return 0;
+ }
+ if (mp->hwe && mp->hwe->flush_on_last_del != FLUSH_UNDEF) {
+ mp->flush_on_last_del = mp->hwe->flush_on_last_del;
+ condlog(3, "flush_on_last_del = %i (controler setting)",
+ mp->flush_on_last_del);
+ return 0;
+ }
+ if (conf->flush_on_last_del != FLUSH_UNDEF) {
+ mp->flush_on_last_del = conf->flush_on_last_del;
+ condlog(3, "flush_on_last_del = %i (config file default)",
+ mp->flush_on_last_del);
+ return 0;
+ }
+ mp->flush_on_last_del = FLUSH_UNDEF;
+ condlog(3, "flush_on_last_del = DISABLED (internal default)");
+ return 0;
+}
+
+extern int
select_pg_timeout(struct multipath *mp)
{
if (mp->mpe && mp->mpe->pg_timeout != PGTIMEOUT_UNDEF) {
--- multipath-tools/libmultipath/propsel.h 2008/08/25 20:59:06 1.5.2.1
+++ multipath-tools/libmultipath/propsel.h 2008/09/04 20:09:48 1.5.2.2
@@ -14,3 +14,4 @@
int select_mode(struct multipath *mp);
int select_uid(struct multipath *mp);
int select_gid(struct multipath *mp);
+int select_flush_on_last_del(struct multipath *mp);
--- multipath-tools/libmultipath/structs.h 2008/08/29 21:30:34 1.18.2.4
+++ multipath-tools/libmultipath/structs.h 2008/09/04 20:09:48 1.18.2.5
@@ -71,6 +71,13 @@
ATTR_MODE,
};

+enum flush_states {
+ FLUSH_UNDEF,
+ FLUSH_DISABLED,
+ FLUSH_ENABLED,
+ FLUSH_IN_PROGRESS,
+};
+
struct scsi_idlun {
int dev_id;
int host_unique_id;
@@ -145,6 +152,7 @@
int minio;
int pg_timeout;
int attribute_flags;
+ int flush_on_last_del;
uid_t uid;
gid_t gid;
mode_t mode;
--- multipath-tools/libmultipath/structs_vec.c 2008/08/25 20:59:06 1.1.2.2
+++ multipath-tools/libmultipath/structs_vec.c 2008/09/04 20:09:48 1.1.2.3
@@ -290,6 +290,7 @@
select_pgfailback(mpp);
set_no_path_retry(mpp);
select_pg_timeout(mpp);
+ select_flush_on_last_del(mpp);

return 0;
out:
--- multipath-tools/multipathd/cli.c 2007/01/10 20:08:09 1.5.2.1
+++ multipath-tools/multipathd/cli.c 2008/09/04 20:09:48 1.5.2.2
@@ -129,6 +129,8 @@
r += add_key(keys, "resume", RESUME, 0);
r += add_key(keys, "reinstate", REINSTATE, 0);
r += add_key(keys, "fail", FAIL, 0);
+ r += add_key(keys, "disablequeueing", DISABLEQ, 0);
+ r += add_key(keys, "restorequeueing", RESTOREQ, 0);
r += add_key(keys, "paths", PATHS, 0);
r += add_key(keys, "maps", MAPS, 0);
r += add_key(keys, "multipaths", MAPS, 0);
--- multipath-tools/multipathd/cli.h 2007/01/10 20:08:09 1.5.2.1
+++ multipath-tools/multipathd/cli.h 2008/09/04 20:09:48 1.5.2.2
@@ -7,6 +7,8 @@
__RESUME,
__REINSTATE,
__FAIL,
+ __DISABLEQ,
+ __RESTOREQ,
__PATHS,
__MAPS,
__PATH,
@@ -29,6 +31,8 @@
#define RESUME (1 << __RESUME)
#define REINSTATE (1 << __REINSTATE)
#define FAIL (1 << __FAIL)
+#define DISABLEQ (1 << __DISABLEQ)
+#define RESTOREQ (1 << __RESTOREQ)
#define PATHS (1 << __PATHS)
#define MAPS (1 << __MAPS)
#define PATH (1 << __PATH)
--- multipath-tools/multipathd/cli_handlers.c 2007/01/10 20:08:09 1.6.2.1
+++ multipath-tools/multipathd/cli_handlers.c 2008/09/04 20:09:48 1.6.2.2
@@ -336,6 +336,48 @@
}

int
+cli_restore_queueing(void *v, char **reply, int *len, void *data)
+{
+ struct vectors * vecs = (struct vectors *)data;
+ char * mapname = get_keyparam(v, MAP);
+ struct multipath *mpp;
+ int minor;
+
+ if (sscanf(mapname, "dm-%d", &minor) == 1)
+ mpp = find_mp_by_minor(vecs->mpvec, minor);
+ else
+ mpp = find_mp_by_alias(vecs->mpvec, mapname);
+
+ if (mpp->no_path_retry != NO_PATH_RETRY_UNDEF &&
+ mpp->no_path_retry != NO_PATH_RETRY_FAIL) {
+ dm_queue_if_no_path(mpp->alias, 1);
+ if (mpp->nr_active > 0)
+ mpp->retry_tick = 0;
+ else
+ mpp->retry_tick = mpp->no_path_retry * conf->checkint;
+ }
+ return 0;
+}
+
+int
+cli_disable_queueing(void *v, char **reply, int *len, void *data)
+{
+ struct vectors * vecs = (struct vectors *)data;
+ char * mapname = get_keyparam(v, MAP);
+ struct multipath *mpp;
+ int minor;
+
+ if (sscanf(mapname, "dm-%d", &minor) == 1)
+ mpp = find_mp_by_minor(vecs->mpvec, minor);
+ else
+ mpp = find_mp_by_alias(vecs->mpvec, mapname);
+
+ mpp->retry_tick = 0;
+ dm_queue_if_no_path(mpp->alias, 0);
+ return 0;
+}
+
+int
cli_switch_group(void * v, char ** reply, int * len, void * data)
{
char * mapname = get_keyparam(v, MAP);
--- multipath-tools/multipathd/cli_handlers.h 2007/01/10 20:08:09 1.3.2.1
+++ multipath-tools/multipathd/cli_handlers.h 2008/09/04 20:09:48 1.3.2.2
@@ -13,6 +13,8 @@
int cli_del_map (void * v, char ** reply, int * len, void * data);
int cli_switch_group(void * v, char ** reply, int * len, void * data);
int cli_reconfigure(void * v, char ** reply, int * len, void * data);
+int cli_disable_queueing(void * v, char ** reply, int * len, void * data);
+int cli_restore_queueing(void * v, char ** reply, int * len, void * data);
int cli_suspend(void * v, char ** reply, int * len, void * data);
int cli_resume(void * v, char ** reply, int * len, void * data);
int cli_reinstate(void * v, char ** reply, int * len, void * data);
--- multipath-tools/multipathd/main.c 2008/08/29 21:30:34 1.69.2.9
+++ multipath-tools/multipathd/main.c 2008/09/04 20:09:48 1.69.2.10
@@ -406,6 +406,7 @@
return 1; /* leave path added to pathvec */

verify_paths(mpp, vecs, NULL);
+ mpp->flush_on_last_del = FLUSH_UNDEF;
mpp->action = ACT_RELOAD;
}
else {
@@ -511,6 +512,13 @@
* flush_map will fail if the device is open
*/
strncpy(alias, mpp->alias, WWID_SIZE);
+ if (mpp->flush_on_last_del == FLUSH_ENABLED) {
+ condlog(2, "%s Last path deleted, disabling queueing", mpp->alias);
+ mpp->retry_tick = 0;
+ mpp->no_path_retry = NO_PATH_RETRY_FAIL;
+ mpp->flush_on_last_del == FLUSH_IN_PROGRESS;
+ dm_queue_if_no_path(mpp->alias, 0);
+ }
if (flush_map(mpp, vecs))
rm_path = 0;
else
@@ -563,6 +571,13 @@
* flush_map will fail if the device is open
*/
strncpy(alias, mpp->alias, WWID_SIZE);
+ if (mpp->flush_on_last_del == FLUSH_ENABLED) {
+ condlog(2, "%s Last path deleted, disabling queueing", mpp->alias);
+ mpp->retry_tick = 0;
+ mpp->no_path_retry = NO_PATH_RETRY_FAIL;
+ mpp->flush_on_last_del == FLUSH_IN_PROGRESS;
+ dm_queue_if_no_path(mpp->alias, 0);
+ }
if (flush_map(mpp, vecs))
rm_path = 0;
else
@@ -746,6 +761,8 @@
add_handler(RESUME+MAP, cli_resume);
add_handler(REINSTATE+PATH, cli_reinstate);
add_handler(FAIL+PATH, cli_fail);
+ add_handler(DISABLEQ+MAP, cli_disable_queueing);
+ add_handler(RESTOREQ+MAP, cli_restore_queueing);

uxsock_listen(&uxsock_trigger, ap);


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

09-08-2008 10:01 PM

multipath-tools ./multipath.conf.annotated ./m ...
 
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2008-09-08 22:01:20

Modified files:
. : multipath.conf.annotated
multipath.conf.synthetic
libmultipath : config.h dict.c structs.h waiter.c
multipathd : main.c

Log message:
Fix for bz #419581. There is a new default multipath.conf option,
queue_without_daemon. It defaults to 'yes'. If it is set to 'no', when
multipathd is stopped, queue_if_no_path is disabled.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.annotated.diff?cvsroot=dm&only_with _tag=RHEL5_FC6&r1=1.18.2.8&r2=1.18.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.synthetic.diff?cvsroot=dm&only_with _tag=RHEL5_FC6&r1=1.11.2.5&r2=1.11.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r 1=1.18.2.6&r2=1.18.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/dict.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1= 1.17.2.7&r2=1.17.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/structs.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6& r1=1.18.2.5&r2=1.18.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/waiter.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r 1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1= 1.69.2.11&r2=1.69.2.12

--- multipath-tools/multipath.conf.annotated 2008/09/04 20:09:48 1.18.2.8
+++ multipath-tools/multipath.conf.annotated 2008/09/08 22:01:19 1.18.2.9
@@ -121,6 +121,7 @@
# #
# #no_path_retry queue
#
+# #
# # name : flush_on_last_del
# # scope : multipathd
# # desc : If set to "yes", multipathd will disable queueing when the
@@ -131,6 +132,16 @@
# flush_on_last_del yes
#
# #
+# # name : queue_without_daemon
+# # scope : multipathd
+# # desc : If set to "no", multipathd will disable queueing for all
+# # devices when it is shut down.
+# # values : yes|no
+# # default : yes
+# #
+# flush_on_last_del no
+#
+# #
# # name : user_friendly_names
# # scope : multipath
# # desc : If set to "yes", using the bindings file
--- multipath-tools/multipath.conf.synthetic 2008/09/04 20:09:48 1.11.2.5
+++ multipath-tools/multipath.conf.synthetic 2008/09/08 22:01:19 1.11.2.6
@@ -17,6 +17,7 @@
# no_path_retry fail
# user_friendly_names no
# flush_on_last_del no
+# queue_without_daemon no
# mode 0666
# uid 0
# gid 0
--- multipath-tools/libmultipath/config.h 2008/09/04 20:09:48 1.18.2.6
+++ multipath-tools/libmultipath/config.h 2008/09/08 22:01:20 1.18.2.7
@@ -75,6 +75,7 @@
int force_reload;
int attribute_flags;
int flush_on_last_del;
+ int queue_without_daemon;
uid_t uid;
gid_t gid;
mode_t mode;
--- multipath-tools/libmultipath/dict.c 2008/09/04 20:09:48 1.17.2.7
+++ multipath-tools/libmultipath/dict.c 2008/09/08 22:01:20 1.17.2.8
@@ -317,6 +317,28 @@
}

static int
+def_queue_without_daemon(vector strvec)
+{
+ char * buff;
+
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+
+ if (!strncmp(buff, "off", 3) || !strncmp(buff, "no", 2) ||
+ !strncmp(buff, "0", 1))
+ conf->queue_without_daemon = QUE_NO_DAEMON_OFF;
+ else if (!strncmp(buff, "on", 2) || !strncmp(buff, "yes", 3) ||
+ !strncmp(buff, "1", 1))
+ conf->queue_without_daemon = QUE_NO_DAEMON_ON;
+ else
+ conf->queue_without_daemon = QUE_NO_DAEMON_UNDEF;
+
+ free(buff);
+ return 0;
+}
+
+static int
def_pg_timeout_handler(vector strvec)
{
int pg_timeout;
@@ -1812,6 +1834,18 @@
}

static int
+snprint_def_queue_without_daemon (char * buff, int len, void * data)
+{
+ switch (conf->queue_without_daemon) {
+ case QUE_NO_DAEMON_OFF:
+ return snprintf(buff, len, "no");
+ case QUE_NO_DAEMON_ON:
+ return snprintf(buff, len, "yes");
+ }
+ return 0;
+}
+
+static int
snprint_def_flush_on_last_del (char * buff, int len, void * data)
{
switch (conf->flush_on_last_del) {
@@ -1906,6 +1940,7 @@
install_keyword("max_fds", &max_fds_handler, &snprint_max_fds);
install_keyword("rr_weight", &def_weight_handler, &snprint_def_rr_weight);
install_keyword("no_path_retry", &def_no_path_retry_handler, &snprint_def_no_path_retry);
+ install_keyword("queue_without_daemon", &def_queue_without_daemon, &snprint_def_queue_without_daemon);
install_keyword("flush_on_last_del", &def_flush_on_last_del_handler, &snprint_def_flush_on_last_del);
install_keyword("pg_timeout", &def_pg_timeout_handler, &snprint_def_pg_timeout);
install_keyword("user_friendly_names", &names_handler, &snprint_def_user_friendly_names);
--- multipath-tools/libmultipath/structs.h 2008/09/04 20:09:48 1.18.2.5
+++ multipath-tools/libmultipath/structs.h 2008/09/08 22:01:20 1.18.2.6
@@ -78,6 +78,12 @@
FLUSH_IN_PROGRESS,
};

+enum queue_without_daemon_states {
+ QUE_NO_DAEMON_UNDEF,
+ QUE_NO_DAEMON_OFF,
+ QUE_NO_DAEMON_ON,
+};
+
struct scsi_idlun {
int dev_id;
int host_unique_id;
--- multipath-tools/libmultipath/waiter.c 2008/08/27 19:14:57 1.1.2.2
+++ multipath-tools/libmultipath/waiter.c 2008/09/08 22:01:20 1.1.2.3
@@ -182,6 +182,8 @@
waiter = (struct event_thread *)et;
pthread_cleanup_push(free_waiter, et);

+ block_signal(SIGUSR1, NULL);
+ block_signal(SIGHUP, NULL);
while (1) {
r = waiteventloop(waiter);

--- multipath-tools/multipathd/main.c 2008/09/04 23:31:39 1.69.2.11
+++ multipath-tools/multipathd/main.c 2008/09/08 22:01:20 1.69.2.12
@@ -1470,6 +1470,8 @@
#ifdef CLONE_NEWNS
unsigned int new_ns = (unsigned long)param & NEW_NS;
#endif
+ struct multipath * mpp;
+ int i;

if (daemon)
setup_daemon();
@@ -1555,6 +1557,9 @@
*/
block_signal(SIGHUP, NULL);
lock(vecs->lock);
+ if (conf->queue_without_daemon == QUE_NO_DAEMON_OFF)
+ vector_foreach_slot(vecs->mpvec, mpp, i)
+ dm_queue_if_no_path(mpp->alias, 0);
remove_maps(vecs, stop_waiter_thread);
free_pathvec(vecs->pathvec, FREE_PATHS);


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

01-16-2009 11:46 PM

multipath-tools ./multipath.conf.annotated ./m ...
 
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL4_FC5
Changes by: bmarzins@sourceware.org 2009-01-17 00:46:52

Modified files:
. : multipath.conf.annotated
multipath.conf.defaults
libmultipath : dict.c hwtable.c structs.h
multipathd : main.c

Log message:
Fixes for bz #214809 and #457228. Added default configs for hp-sw hardware
handler and changed max_fds to use max instead of unlimited, since the kernel
doesn't allow a process to open unlimited fds.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.annotated.diff?cvsroot=dm&only_with _tag=RHEL4_FC5&r1=1.16.2.7&r2=1.16.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.defaults.diff?cvsroot=dm&only_with_ tag=RHEL4_FC5&r1=1.5.2.11&r2=1.5.2.12
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/dict.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1= 1.16.2.6&r2=1.16.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/hwtable.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5& r1=1.16.2.15&r2=1.16.2.16
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/structs.h.diff?cvsroot=dm&only_with_tag=RHEL4_FC5& r1=1.17.2.8&r2=1.17.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1= 1.66.2.5&r2=1.66.2.6

--- multipath-tools/multipath.conf.annotated 2009/01/16 21:30:42 1.16.2.7
+++ multipath-tools/multipath.conf.annotated 2009/01/17 00:46:51 1.16.2.8
@@ -113,7 +113,7 @@
# # scope : multipathd
# # desc : Sets the maximum number of open file descriptors for the
# # multipathd process.
-# # values : unlimited|n > 0
+# # values : max|n > 0
# # default : None
# #
# max_fds 8192
--- multipath-tools/multipath.conf.defaults 2009/01/15 22:47:36 1.5.2.11
+++ multipath-tools/multipath.conf.defaults 2009/01/17 00:46:51 1.5.2.12
@@ -49,7 +49,7 @@
# product "MSA|HSV1.0.*"
# path_grouping_policy group_by_prio
# prio_callout "/sbin/mpath_prio_hp_sw /dev/%n"
-# hardware_handler "1 hp_sw"
+# hardware_handler "1 hp-sw"
# path_checker "hp_sw"
# no_path_retry 12
# rr_min_io 100
@@ -127,8 +127,13 @@
# device {
# vendor "DEC"
# product "HSG80"
-# path_grouping_policy group_by_serial
-# getuid_callout "/sbin/scsi_id -g -u -s"
+# path_grouping_policy group_by_prio
+# prio_callout "/sbin/mpath_prio_hp_sw /dev/%n"
+# hardware_handler "1 hp-sw"
+# features "1 queue_if_no_path"
+# path_checker hp_sw
+# no_path_retry 12
+# rr_min_io 100
# }
# device {
# vendor "DGC"
--- multipath-tools/libmultipath/dict.c 2009/01/16 21:30:43 1.16.2.6
+++ multipath-tools/libmultipath/dict.c 2009/01/17 00:46:51 1.16.2.7
@@ -152,9 +152,9 @@
if (!buff)
return 1;

- if (strlen(buff) == 9 &&
- !strcmp(buff, "unlimited"))
- conf->max_fds = MAX_FDS_UNLIMITED;
+ if (strlen(buff) == 3 &&
+ !strcmp(buff, "max"))
+ conf->max_fds = MAX_FDS_MAX;
else
conf->max_fds = atoi(buff);
FREE(buff);
--- multipath-tools/libmultipath/hwtable.c 2009/01/15 22:47:36 1.16.2.15
+++ multipath-tools/libmultipath/hwtable.c 2009/01/17 00:46:51 1.16.2.16
@@ -14,7 +14,6 @@
r += store_hwe(hw, "3PARdata", "VV", MULTIBUS, DEFAULT_GETUID);
r += store_hwe(hw, "APPLE*", "Xserve RAID ", MULTIBUS, DEFAULT_GETUID);
r += store_hwe(hw, "DDN", "SAN DataDirector", MULTIBUS, DEFAULT_GETUID);
- r += store_hwe(hw, "DEC", "HSG80", GROUP_BY_SERIAL, DEFAULT_GETUID);
r += store_hwe(hw, "EMC", "SYMMETRIX", MULTIBUS,
"/sbin/scsi_id -g -u -ppre-spc3-83 -s /block/%n");
r += store_hwe(hw, "FSC", "CentricStor", GROUP_BY_SERIAL, DEFAULT_GETUID);
@@ -25,7 +24,10 @@
r += store_hwe(hw, "STK", "OPENstorage D280", GROUP_BY_SERIAL, DEFAULT_GETUID);
r += store_hwe(hw, "SUN", "StorEdge 3510", MULTIBUS, DEFAULT_GETUID);
r += store_hwe(hw, "SUN", "T4", MULTIBUS, DEFAULT_GETUID);
-
+ r += store_hwe_ext(hw, "DEC", "HSG80", GROUP_BY_PRIO,
+ DEFAULT_GETUID, "/sbin/mpath_prio_hp_sw /dev/%n",
+ "1 hp-sw", "1 queue_if_no_path", "hp_sw",
+ FAILBACK_UNDEF, NULL, 12, 0, 100);
r + store_hwe_ext(hw, "GNBD", "GNBD", MULTIBUS,
"/sbin/gnbd_import -q -U /block/%n", NULL, "0", "0",
"directio", FAILBACK_UNDEF, NULL, 0, 0, 0);
@@ -35,7 +37,7 @@
100);
r += store_hwe_ext(hw, "COMPAQ", "MSA|HSV1.0.*", GROUP_BY_PRIO,
DEFAULT_GETUID, "/sbin/mpath_prio_hp_sw /dev/%n",
- "1 hp_sw", "0", "hp_sw", FAILBACK_UNDEF, NULL, 12, 0,
+ "1 hp-sw", "0", "hp_sw", FAILBACK_UNDEF, NULL, 12, 0,
100);
r += store_hwe_ext(hw, "(COMPAQ|HP)", "HSV1[01]1|HSV2[01]0|HSV300",
GROUP_BY_PRIO, DEFAULT_GETUID,
--- multipath-tools/libmultipath/structs.h 2008/04/14 22:40:08 1.17.2.8
+++ multipath-tools/libmultipath/structs.h 2009/01/17 00:46:51 1.17.2.9
@@ -20,7 +20,7 @@
#define NO_PATH_RETRY_FAIL -1
#define NO_PATH_RETRY_QUEUE -2

-#define MAX_FDS_UNLIMITED -1
+#define MAX_FDS_MAX (1024 * 1024)

enum free_path_switch {
KEEP_PATHS,
--- multipath-tools/multipathd/main.c 2008/10/17 18:37:53 1.66.2.5
+++ multipath-tools/multipathd/main.c 2009/01/17 00:46:52 1.66.2.6
@@ -1625,14 +1625,9 @@

if (conf->max_fds) {
struct rlimit fd_limit;
- if (conf->max_fds > 0) {
- fd_limit.rlim_cur = conf->max_fds;
- fd_limit.rlim_max = conf->max_fds;
- }
- else {
- fd_limit.rlim_cur = RLIM_INFINITY;
- fd_limit.rlim_max = RLIM_INFINITY;
- }
+
+ fd_limit.rlim_cur = conf->max_fds;
+ fd_limit.rlim_max = conf->max_fds;
if (setrlimit(RLIMIT_NOFILE, &fd_limit) < 0)
condlog(0, "can't set open fds limit to %d : %s
",
conf->max_fds, strerror(errno));

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

10-10-2011 04:15 AM

multipath-tools ./multipath.conf.annotated ./m ...
 
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2011-10-10 04:15:42

Modified files:
. : multipath.conf.annotated
multipath.conf.defaults
libmultipath : dict.c
multipathd : main.c

Log message:
Fix for BZs #702410, #711970, and #715524

Various small cleanups. Keep mutipath from complaining when it fails to add
non-multipath devices. Allow "path_selector" or "selector" in the defaults
section of multipath.conf. Document file_timeout option. Not applicable
upstream.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.annotated.diff?cvsroot=dm&only_with _tag=RHEL5_FC6&r1=1.18.2.18&r2=1.18.2.19
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.defaults.diff?cvsroot=dm&only_with_ tag=RHEL5_FC6&r1=1.5.4.29&r2=1.5.4.30
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/dict.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1= 1.17.2.19&r2=1.17.2.20
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1= 1.69.2.36&r2=1.69.2.37

--- multipath-tools/multipath.conf.annotated 2011/02/18 18:27:00 1.18.2.18
+++ multipath-tools/multipath.conf.annotated 2011/10/10 04:15:41 1.18.2.19
@@ -260,6 +260,16 @@
# # default : determined by the OS
# dev_loss_tmo 600
#
+# #
+# # name : file_timeout
+# # scope : multipath & multipathd
+# # desc : The number of seconds that multipath will wait for
+# # necessary files to appear while setting up a multipath
+# # devices.
+# # values : n > 0
+# # default : 90
+# file_timeout 30
+#
#}
#
##
--- multipath-tools/multipath.conf.defaults 2011/03/07 05:19:36 1.5.4.29
+++ multipath-tools/multipath.conf.defaults 2011/10/10 04:15:41 1.5.4.30
@@ -16,6 +16,7 @@
# user_friendly_names no
# pg_prio_calc sum
# bindings_file "/var/lib/multipath/bindings"
+# file_timeout 90
#}
#
#blacklist {
--- multipath-tools/libmultipath/dict.c 2011/04/05 18:41:45 1.17.2.19
+++ multipath-tools/libmultipath/dict.c 2011/10/10 04:15:41 1.17.2.20
@@ -2150,7 +2150,8 @@
;
install_keyword("polling_interval", &polling_interval_handler, &snprint_def_polling_interval);
install_keyword("udev_dir", &udev_dir_handler, &snprint_def_udev_dir);
- install_keyword("selector", &def_selector_handler, &snprint_def_selector);
+ install_keyword("selector", &def_selector_handler, NULL);
+ install_keyword("path_selector", &def_selector_handler, &snprint_def_selector);
install_keyword("path_grouping_policy", &def_pgpolicy_handler, &snprint_def_path_grouping_policy);
install_keyword("getuid_callout", &def_getuid_callout_handler, &snprint_def_getuid_callout);
install_keyword("prio_callout", &def_prio_callout_handler, &snprint_def_getprio_callout);
--- multipath-tools/multipathd/main.c 2011/10/10 03:47:07 1.69.2.36
+++ multipath-tools/multipathd/main.c 2011/10/10 04:15:41 1.69.2.37
@@ -227,7 +227,8 @@
uev_add_map (char * devname, struct vectors * vecs)
{
condlog(2, "%s: add map (uevent)", devname);
- return ev_add_map(devname, vecs);
+ ev_add_map(devname, vecs);
+ return 0;
}

int

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


All times are GMT. The time now is 10:12 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.