All of lore.kernel.org
 help / color / mirror / Atom feed
* multipath-tools ./multipath.conf.annotated lib ...
@ 2010-04-08 19:31 bmarzins
  0 siblings, 0 replies; 7+ messages in thread
From: bmarzins @ 2010-04-08 19:31 UTC (permalink / raw)
  To: dm-cvs, dm-devel

CVSROOT:	/cvs/dm
Module name:	multipath-tools
Branch: 	RHEL5_FC6
Changes by:	bmarzins@sourceware.org	2010-04-08 19:31:50

Modified files:
	.              : multipath.conf.annotated 
	libmultipath   : config.h configure.c 
	multipath      : main.c 

Log message:
	Fix for bz #579789. Add a -q option to multipath to disable queueing,
	regardless of the configuration setting.  On boot, if a multipath device with
	no useable paths and queue_if_no_path is created, it can cause a hang if IO
	happens to it before multipathd is started.  Using the -q option during boot
	will cause multipath to fail the IO if no paths are up, until multipathd is
	started.

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.15&r2=1.18.2.16
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.18.2.9&r2=1.18.2.10
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/configure.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.2.2.6&r2=1.2.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.44.2.7&r2=1.44.2.8

--- multipath-tools/multipath.conf.annotated	2010/01/27 22:33:28	1.18.2.15
+++ multipath-tools/multipath.conf.annotated	2010/04/08 19:31:49	1.18.2.16
@@ -84,7 +84,8 @@
 #	# name    : path_checker
 #	# scope   : multipath & multipathd
 #	# desc    : the default method used to determine the paths' state
-#	# values  : directio|tur|hp_sw|rdac|emc_clariion|readsector0|cciss_tur
+#	# values  : directio|tur|hp_sw|rdac|emc_clariion|readsector0|cciss_tur|
+#	#           hp_tur
 #	# default : readsector0
 #	#
 #	#path_checker	readsector0
@@ -484,7 +485,7 @@
 #		# scope   : multipathd
 #		# desc    : path checking alorithm to use to check path state
 #		# values  : directio|tur|hp_sw|rdac|emc_clariion|readsector0|
-#		#           cciss_tur
+#		#           cciss_tur|hp_tur
 #		# default : readsector0
 #		#
 #		path_checker		readsector0
--- multipath-tools/libmultipath/config.h	2010/01/27 16:46:48	1.18.2.9
+++ multipath-tools/libmultipath/config.h	2010/04/08 19:31:49	1.18.2.10
@@ -78,6 +78,7 @@
 	int flush_on_last_del;
 	int queue_without_daemon;
 	int checker_timeout;
+	int override_queueing;
 	uid_t uid;
 	gid_t gid;
 	mode_t mode;
--- multipath-tools/libmultipath/configure.c	2009/12/04 21:19:51	1.2.2.6
+++ multipath-tools/libmultipath/configure.c	2010/04/08 19:31:49	1.2.2.7
@@ -537,7 +537,9 @@
 		if (r == DOMAP_DRY)
 			continue;
 
-		if (mpp->no_path_retry != NO_PATH_RETRY_UNDEF) {
+		if (conf->override_queueing)
+			dm_queue_if_no_path(mpp->alias, 0);
+		else if (mpp->no_path_retry != NO_PATH_RETRY_UNDEF) {
 			if (mpp->no_path_retry == NO_PATH_RETRY_FAIL)
 				dm_queue_if_no_path(mpp->alias, 0);
 			else
--- multipath-tools/multipath/main.c	2009/05/04 18:12:07	1.44.2.7
+++ multipath-tools/multipath/main.c	2010/04/08 19:31:49	1.44.2.8
@@ -1,7 +1,7 @@
 /*
  * Soft:        multipath device mapper target autoconfig
  *
- * Version:     $Id: main.c,v 1.44.2.7 2009/05/04 18:12:07 bmarzins Exp $
+ * Version:     $Id: main.c,v 1.44.2.8 2010/04/08 19:31:49 bmarzins Exp $
  *
  * Author:      Christophe Varoqui
  *
@@ -84,6 +84,7 @@
 		"\t   2\t\t\tdefault verbosity\n" \
 		"\t   3\t\t\tprint debug information\n" \
 		"\t-h\t\tprint this usage text\n" \
+		"\t-q\t\tforce all maps to turn off queue_if_no_path\n"\
 		"\t-b file\t\tbindings file location\n" \
 		"\t-d\t\tdry run, do not create or update devmaps\n" \
 		"\t-l\t\tshow multipath topology (sysfs and DM info)\n" \
@@ -324,7 +325,7 @@
 	if (load_config(DEFAULT_CONFIGFILE))
 		exit(1);
 
-	while ((arg = getopt(argc, argv, ":dhl::FfM:v:p:b:r")) != EOF ) {
+	while ((arg = getopt(argc, argv, ":dhl::FfM:v:p:b:rq")) != EOF ) {
 		switch(arg) {
 		case 1: printf("optarg : %s\n",optarg);
 			break;
@@ -335,6 +336,9 @@
 
 			conf->verbosity = atoi(optarg);
 			break;
+		case 'q':
+			conf->override_queueing = 1;
+			break;
 		case 'b':
 			if (conf->bindings_file)
 				FREE(conf->bindings_file);	

^ permalink raw reply	[flat|nested] 7+ messages in thread

* multipath-tools ./multipath.conf.annotated lib ...
@ 2011-02-18 18:27 bmarzins
  0 siblings, 0 replies; 7+ messages in thread
From: bmarzins @ 2011-02-18 18:27 UTC (permalink / raw)
  To: dm-cvs, dm-devel

CVSROOT:	/cvs/dm
Module name:	multipath-tools
Branch: 	RHEL5_FC6
Changes by:	bmarzins@sourceware.org	2011-02-18 18:27:00

Modified files:
	.              : multipath.conf.annotated 
	libmultipath   : config.h configure.c dict.c discovery.c 
	                 discovery.h propsel.c propsel.h structs.h 
	                 util.c util.h 
	multipathd     : copy.c main.c 

Log message:
	Backport dev_loss_tmo and fast_io_fail_tmo multipath.conf options to RHEL5.
	Fix for bz #672575

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.17&r2=1.18.2.18
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.18.2.13&r2=1.18.2.14
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/configure.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.2.2.10&r2=1.2.2.11
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/dict.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.17.2.16&r2=1.17.2.17
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/discovery.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.32.2.17&r2=1.32.2.18
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/discovery.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.14.2.5&r2=1.14.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/propsel.c.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/propsel.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.5.2.2&r2=1.5.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/structs.h.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/libmultipath/util.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/libmultipath/util.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.4.2.1&r2=1.4.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/copy.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.5.2.3&r2=1.5.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.31&r2=1.69.2.32

--- multipath-tools/multipath.conf.annotated	2010/09/03 22:23:22	1.18.2.17
+++ multipath-tools/multipath.conf.annotated	2011/02/18 18:27:00	1.18.2.18
@@ -240,6 +240,26 @@
 #	# default : taken for /sys/block/sd<x>/device/timeout
 #	checker_timeout 60
 #
+#      #
+#      # name    : fast_io_fail_tmo
+#      # scope   : multipath & multipathd
+#      # desc    : The number of seconds the scsi layer will wait after a
+#      #           problem has been detected on a FC remote port before failing
+#      #           IO to devices on that remote port.
+#      # values  : off | n >= 0 (smaller than dev_loss_tmo)
+#      # default : determined by the OS
+#      fast_io_fail_tmo 5
+#
+#      #
+#      # name    : dev_loss_tmo
+#      # scope   : multipath & multipathd
+#      # desc    : The number of seconds the scsi layer will wait after a
+#      #           problem has been detected on a FC remote port before
+#      #           removing it from the system.
+#      # values  : n > 0
+#      # default : determined by the OS
+#      dev_loss_tmo 600
+#
 #}
 #	
 ##
@@ -590,6 +610,24 @@
 #		# default : none
 #		#
 #		product_blacklist	LUN_Z
+#
+#              #
+#              # name    : fast_io_fail_tmo
+#              # scope   : multipath & multipathd
+#              # desc    : The number of seconds the scsi layer will wait after
+#              #           a problem has been detected on a FC remote port
+#              #           before failing IO to devices on that remote port.
+#              # values  : off | n >= 0 (smaller than dev_loss_tmo)
+#              fast_io_fail_tmo 5
+#
+#              #
+#              # name    : dev_loss_tmo
+#              # scope   : multipath & multipathd
+#              # desc    : The number of seconds the scsi layer will wait after
+#              #           a problem has been detected on a FC remote port
+#              #           before removing it from the system.
+#              # values  : n > 0
+#              dev_loss_tmo 600
 #	}
 #	device {
 #		vendor			"COMPAQ  "
--- multipath-tools/libmultipath/config.h	2010/09/08 21:40:29	1.18.2.13
+++ multipath-tools/libmultipath/config.h	2011/02/18 18:27:00	1.18.2.14
@@ -30,6 +30,8 @@
 	int minio;
 	int pg_timeout;
 	int flush_on_last_del;
+	int fast_io_fail;
+	unsigned int dev_loss;
 	struct checker * checker;
 	char * bl_product;
 };
@@ -81,6 +83,8 @@
 	int allow_queueing;
 	int pg_prio_calc;
 	int log_checker_err;
+	int fast_io_fail;
+	unsigned int dev_loss;
 	uid_t uid;
 	gid_t gid;
 	mode_t mode;
--- multipath-tools/libmultipath/configure.c	2011/02/16 19:00:51	1.2.2.10
+++ multipath-tools/libmultipath/configure.c	2011/02/18 18:27:00	1.2.2.11
@@ -35,6 +35,7 @@
 #include "dict.h"
 #include "alias.h"
 #include "devmapper.h"
+#include "util.h"
 
 extern int
 setup_map (struct multipath * mpp)
@@ -62,7 +63,10 @@
 	select_minio(mpp);
 	select_no_path_retry(mpp);
 	select_pg_timeout(mpp);
+	select_fast_io_fail(mpp);
+	select_dev_loss(mpp);
 
+	sysfs_set_scsi_tmo(mpp);
 	/*
 	 * assign paths to path groups -- start with no groups and all paths
 	 * in mpp->paths
@@ -635,7 +639,7 @@
 		return NULL;
 
 	if (dev_type == DEV_DEVNODE) {
-		basename(dev, buff);
+		basenamecpy(dev, buff);
 		pp = find_path_by_dev(pathvec, buff);
 		
 		if (!pp) {
--- multipath-tools/libmultipath/dict.c	2010/09/10 14:25:20	1.17.2.16
+++ multipath-tools/libmultipath/dict.c	2011/02/18 18:27:00	1.17.2.17
@@ -35,6 +35,35 @@
 }
 
 static int
+def_fast_io_fail_handler(vector strvec)
+{
+	char * buff;
+
+	buff = set_value(strvec);
+	if (strlen(buff) == 3 && !strcmp(buff, "off"))
+		conf->fast_io_fail = -1;
+	else if (sscanf(buff, "%d", &conf->fast_io_fail) != 1 ||
+			conf->fast_io_fail < -1)
+		conf->fast_io_fail = 0;
+
+	FREE(buff);
+	return 0;
+}
+
+static int
+def_dev_loss_handler(vector strvec)
+{
+	char * buff;
+
+	buff = set_value(strvec);
+	if (sscanf(buff, "%u", &conf->dev_loss) != 1)
+		conf->dev_loss = 0;
+
+	FREE(buff);
+	return 0;
+}
+
+static int
 verbosity_handler(vector strvec)
 {
 	char * buff;
@@ -694,6 +723,37 @@
 }
 
 static int
+hw_fast_io_fail_handler(vector strvec)
+{
+	char * buff;
+	struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
+
+	buff = set_value(strvec);
+	if (strlen(buff) == 3 && !strcmp(buff, "off"))
+		hwe->fast_io_fail = -1;
+	else if (sscanf(buff, "%d", &hwe->fast_io_fail) != 1 ||
+			hwe->fast_io_fail < -1)
+		hwe->fast_io_fail = 0;
+
+	FREE(buff);
+	return 0;
+}
+
+static int
+hw_dev_loss_handler(vector strvec)
+{
+	char * buff;
+	struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
+
+	buff = set_value(strvec);
+	if (sscanf(buff, "%u", &hwe->dev_loss) != 1)
+		hwe->dev_loss = 0;
+
+	FREE(buff);
+	return 0;
+}
+
+static int
 hw_pgpolicy_handler(vector strvec)
 {
 	char * buff;
@@ -1502,6 +1562,26 @@
 }
 
 static int
+snprint_hw_fast_io_fail(char * buff, int len, void * data)
+{
+	struct hwentry * hwe = (struct hwentry *)data;
+	if (!hwe->fast_io_fail)
+		return 0;
+	if (hwe->fast_io_fail == -1)
+		return snprintf(buff, len, "off");
+	return snprintf(buff, len, "%d", hwe->fast_io_fail);
+}
+
+static int
+snprint_hw_dev_loss(char * buff, int len, void * data)
+{
+	struct hwentry * hwe = (struct hwentry *)data;
+	if (!hwe->dev_loss)
+		return 0;
+	return snprintf(buff, len, "%u", hwe->dev_loss);
+}
+
+static int
 snprint_hw_vendor (char * buff, int len, void * data)
 {
 	struct hwentry * hwe = (struct hwentry *)data;
@@ -1726,6 +1806,24 @@
 }
 
 static int
+snprint_def_fast_io_fail(char * buff, int len, void * data)
+{
+	if (!conf->fast_io_fail)
+		return 0;
+	if (conf->fast_io_fail == -1)
+		return snprintf(buff, len, "off");
+	return snprintf(buff, len, "%d", conf->fast_io_fail);
+}
+
+static int
+snprint_def_dev_loss(char * buff, int len, void * data)
+{
+	if (!conf->dev_loss)
+		return 0;
+	return snprintf(buff, len, "%u", conf->dev_loss);
+}
+
+static int
 snprint_def_verbosity (char * buff, int len, void * data)
 {
 	return snprintf(buff, len, "%i", conf->verbosity);
@@ -2035,6 +2133,8 @@
 	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);
+	install_keyword("fast_io_fail_tmo", &def_fast_io_fail_handler, &snprint_def_fast_io_fail);
+	install_keyword("dev_loss_tmo", &def_dev_loss_handler, &snprint_def_dev_loss);
 	__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);
@@ -2089,6 +2189,8 @@
 	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_keyword("fast_io_fail_tmo", &hw_fast_io_fail_handler, &snprint_hw_fast_io_fail);
+	install_keyword("dev_loss_tmo", &hw_dev_loss_handler, &snprint_hw_dev_loss);
 	install_sublevel_end();
 
 	install_keyword_root("multipaths", &multipaths_handler);
--- multipath-tools/libmultipath/discovery.c	2010/11/30 17:21:19	1.32.2.17
+++ multipath-tools/libmultipath/discovery.c	2011/02/18 18:27:00	1.32.2.18
@@ -11,6 +11,7 @@
 #include <errno.h>
 #include <sysfs/dlist.h>
 #include <sysfs/libsysfs.h>
+#include <libgen.h>
 
 #include <checkers.h>
 
@@ -477,6 +478,123 @@
 }
 
 static int
+find_rport_id(struct path *pp)
+{
+	char attr_path[SYSFS_PATH_SIZE];
+	char link_path[SYSFS_PATH_SIZE];
+	char *dir, *base;
+	int host, channel, rport_id = -1;
+	int len;
+
+	if (safe_sprintf(attr_path,
+			 "%s/class/fc_transport/target%i:%i:%i/device",
+			 sysfs_path, pp->sg_id.host_no, pp->sg_id.channel,
+			 pp->sg_id.scsi_id)) {
+		condlog(0, "attr_path too small for target");
+		return -1;
+	}
+	len = readlink(attr_path, link_path, SYSFS_PATH_SIZE);
+	if (len < 0) {
+		condlog(3, "failed to read link '%s' : %s", attr_path,
+			strerror(errno));
+		return -1;
+	}
+	link_path[(len < SYSFS_PATH_SIZE)? len : len - 1] = '\0';
+	dir = link_path;
+	do {
+		base = basename(dir);
+		dir = dirname(dir);
+
+		if (sscanf(base, "rport-%d:%d-%d", &host,
+		    &channel, &rport_id) == 3)
+			break;
+	} while (strcmp(dir, "/") && strcmp(dir, "."));
+
+	if (rport_id < 0)
+		return -1;
+
+	return rport_id;
+}
+
+
+static int
+sysfs_attr_set_value(const char *devpath, const char *attr_name,
+		     const char *value)
+{
+	char attr_path[SYSFS_PATH_SIZE];
+	struct sysfs_attribute * attr;
+	int ret = -1;
+
+	if (safe_sprintf(attr_path, "%s%s/%s", sysfs_path, devpath,
+			 attr_name)) {
+		condlog(0, "sysfs_path %s%s/%s too large", sysfs_path,
+			devpath, attr_name);
+		return ret;
+	}
+	attr = sysfs_open_attribute(attr_path);
+	if (!attr) {
+		condlog(0, "failed to open %s : %s", attr_path,
+			strerror(errno));
+		return ret;
+	}
+	if (sysfs_write_attribute(attr, value, strlen(value)) < 0) {
+		condlog(0, "failed to write '%s' to %s : %s", value, attr_path,
+			strerror(errno));
+		goto out;
+	}
+	ret = 0;
+out:
+	sysfs_close_attribute(attr);
+	return ret;
+}
+
+int
+sysfs_set_scsi_tmo (struct multipath *mpp)
+{
+	char attr_path[SYSFS_PATH_SIZE];
+	struct path *pp;
+	int i;
+	char value[11];
+	int rport_id;
+
+	if (!mpp->dev_loss && !mpp->fast_io_fail)
+		return 0;
+	vector_foreach_slot(mpp->paths, pp, i) {
+		rport_id = find_rport_id(pp);
+		if (rport_id < 0) {
+			condlog(0, "failed to find rport_id for target%d:%d:%d",
+				pp->sg_id.host_no, pp->sg_id.channel,
+				pp->sg_id.scsi_id);
+			return 1;
+		}
+		if (safe_snprintf(attr_path, SYSFS_PATH_SIZE,
+				  "/class/fc_remote_ports/rport-%d:%d-%d",
+				  pp->sg_id.host_no, pp->sg_id.channel,
+				  rport_id)) {
+			condlog(0, "attr_path '/class/fc_remote_ports/rport-%d:%d-%d' too large", pp->sg_id.host_no, pp->sg_id.channel, rport_id);
+
+			return 1;
+		}
+		if (mpp->fast_io_fail){
+			if (mpp->fast_io_fail == -1)
+				sprintf(value, "off");
+			else
+				snprintf(value, 11, "%u", mpp->fast_io_fail);
+			if (sysfs_attr_set_value(attr_path, "fast_io_fail_tmo",
+						value))
+				return 1;
+		}
+		if (mpp->dev_loss){
+			snprintf(value, 11, "%u", mpp->dev_loss);
+			if (sysfs_attr_set_value(attr_path, "dev_loss_tmo",
+						value))
+				return 1;
+		}
+	}
+	return 0;
+}
+
+static int
 sysfs_get_bus (char * sysfs_path, struct path * pp)
 {
 	struct sysfs_device *sdev;
@@ -590,7 +708,7 @@
 	if (0 > sysfs_get_link(attr_path, attr_buff, sizeof(attr_buff)))
 		return 1;
 	
-	basename(attr_buff, attr_path);
+	basenamecpy(attr_buff, attr_path);
 
 	sscanf(attr_path, "%i:%i:%i:%i",
 			&pp->sg_id.host_no,
@@ -674,7 +792,7 @@
 	if (0 > sysfs_get_link(attr_path, attr_buff, sizeof(attr_buff)))
 		return 1;
 	
-	basename(attr_buff, attr_path);
+	basenamecpy(attr_buff, attr_path);
 	pp->sg_id.lun = 0;
 	sscanf(attr_path, "%i.%i.%x",
 			&pp->sg_id.host_no,
--- multipath-tools/libmultipath/discovery.h	2010/09/03 03:46:12	1.14.2.5
+++ multipath-tools/libmultipath/discovery.h	2011/02/18 18:27:00	1.14.2.6
@@ -33,9 +33,9 @@
 int sysfs_get_state (char * sysfs_path, char * dev, char * buff, int len);
 int sysfs_get_size (char * sysfs_path, char * dev, unsigned long long *);
 int sysfs_get_timeout (char * sysfs_path, char * dev, unsigned int *timeout);
+int sysfs_set_scsi_tmo (struct multipath *mpp);
 int path_discovery (vector pathvec, struct config * conf, int flag);
 
-void basename (char *, char *);
 int do_tur (char *);
 int devt2devname (char *, char *);
 int pathinfo (struct path *, vector hwtable, int mask);
--- multipath-tools/libmultipath/propsel.c	2010/01/27 22:33:29	1.11.2.5
+++ multipath-tools/libmultipath/propsel.c	2011/02/18 18:27:00	1.11.2.6
@@ -479,3 +479,45 @@
 	condlog(3, "pg_timeout = NONE (internal default)");
 	return 0;
 }
+
+extern int
+select_fast_io_fail(struct multipath *mp)
+{
+	if (mp->hwe && mp->hwe->fast_io_fail) {
+		mp->fast_io_fail = mp->hwe->fast_io_fail;
+		if (mp->fast_io_fail == -1)
+			condlog(3, "%s: fast_io_fail_tmo = off (controller default)", mp->alias);
+		else
+			condlog(3, "%s: fast_io_fail_tmo = %d (controller default)", mp->alias, mp->fast_io_fail);
+		return 0;
+	}
+	if (conf->fast_io_fail) {
+		mp->fast_io_fail = conf->fast_io_fail;
+		if (mp->fast_io_fail == -1)
+			condlog(3, "%s: fast_io_fail_tmo = off (config file default)", mp->alias);
+		else
+			condlog(3, "%s: fast_io_fail_tmo = %d (config file default)", mp->alias, mp->fast_io_fail);
+		return 0;
+	}
+	mp->fast_io_fail = 0;
+	return 0;
+}
+
+extern int
+select_dev_loss(struct multipath *mp)
+{
+	if (mp->hwe && mp->hwe->dev_loss) {
+		mp->dev_loss = mp->hwe->dev_loss;
+		condlog(3, "%s: dev_loss_tmo = %u (controller default)",
+				mp->alias, mp->dev_loss);
+		return 0;
+	}
+	if (conf->dev_loss) {
+		mp->dev_loss = conf->dev_loss;
+		condlog(3, "%s: dev_loss_tmo = %u (config file default)",
+				mp->alias, mp->dev_loss);
+		return 0;
+	}
+	mp->dev_loss = 0;
+	return 0;
+}
--- multipath-tools/libmultipath/propsel.h	2008/09/04 20:09:48	1.5.2.2
+++ multipath-tools/libmultipath/propsel.h	2011/02/18 18:27:00	1.5.2.3
@@ -15,3 +15,5 @@
 int select_uid(struct multipath *mp);
 int select_gid(struct multipath *mp);
 int select_flush_on_last_del(struct multipath *mp);
+int select_fast_io_fail(struct multipath *mp);
+int select_dev_loss(struct multipath *mp);
--- multipath-tools/libmultipath/structs.h	2010/09/08 21:40:30	1.18.2.8
+++ multipath-tools/libmultipath/structs.h	2011/02/18 18:27:00	1.18.2.9
@@ -169,6 +169,8 @@
 	int pg_timeout;
 	int attribute_flags;
 	int flush_on_last_del;
+	int fast_io_fail;
+	unsigned int dev_loss;
 	uid_t uid;
 	gid_t gid;
 	mode_t mode;
--- multipath-tools/libmultipath/util.c	2007/06/18 17:37:18	1.5.2.1
+++ multipath-tools/libmultipath/util.c	2011/02/18 18:27:00	1.5.2.2
@@ -39,7 +39,7 @@
 }
 
 void
-basename (char * str1, char * str2)
+basenamecpy (char * str1, char * str2)
 {
 	char *p = str1 + (strlen(str1) - 1);
 
--- multipath-tools/libmultipath/util.h	2007/06/18 17:37:18	1.4.2.1
+++ multipath-tools/libmultipath/util.h	2011/02/18 18:27:00	1.4.2.2
@@ -3,7 +3,7 @@
 
 int strcmp_chomp(char *, char *);
 void strchop(char *);
-void basename (char * src, char * dst);
+void basenamecpy (char * src, char * dst);
 int filepresent (char * run);
 int get_word (char * sentence, char ** word);
 void cciss_basename (char * , char * );
--- multipath-tools/multipathd/Attic/copy.c	2009/08/19 21:52:40	1.5.2.3
+++ multipath-tools/multipathd/Attic/copy.c	2011/02/18 18:27:00	1.5.2.4
@@ -91,7 +91,7 @@
 	char dst[FILESIZE];
 	char filename[FILESIZE];
 	
-	basename(src, filename);
+	basenamecpy(src, filename);
 	if (FILESIZE <= snprintf(dst, FILESIZE, "%s/%s", dstdir, filename)) {
 		condlog(0, "[copy.c] filename buffer overflow : %s ", filename);
 		return -1;
--- multipath-tools/multipathd/main.c	2010/12/07 06:02:23	1.69.2.31
+++ multipath-tools/multipathd/main.c	2011/02/18 18:27:00	1.69.2.32
@@ -695,7 +695,7 @@
 	if (uev_discard(uev->devpath))
 		return 0;
 
-	basename(uev->devpath, devname);
+	basenamecpy(uev->devpath, devname);
 	lock(vecs->lock);
 
 	/*

^ permalink raw reply	[flat|nested] 7+ messages in thread

* multipath-tools ./multipath.conf.annotated lib ...
@ 2010-01-27 22:33 bmarzins
  0 siblings, 0 replies; 7+ messages in thread
From: bmarzins @ 2010-01-27 22:33 UTC (permalink / raw)
  To: dm-cvs, dm-devel

CVSROOT:	/cvs/dm
Module name:	multipath-tools
Branch: 	RHEL5_FC6
Changes by:	bmarzins@sourceware.org	2010-01-27 22:33:29

Modified files:
	.              : multipath.conf.annotated 
	libmultipath   : discovery.c propsel.c 

Log message:
	Make checker_timeout be in seconds.

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.14&r2=1.18.2.15
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/discovery.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.32.2.12&r2=1.32.2.13
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/propsel.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.11.2.4&r2=1.11.2.5

--- multipath-tools/multipath.conf.annotated	2009/08/31 18:43:18	1.18.2.14
+++ multipath-tools/multipath.conf.annotated	2010/01/27 22:33:28	1.18.2.15
@@ -219,7 +219,15 @@
 #	# default : determined by the process
 #	gid     0
 #
-
+#	#
+#	# name    : checker_timeout
+#	# scope   : multipath & multipathd
+#	# desc    : The timeout to use for path checkers that issue scsi
+#	#           commands with an explicit timeout, in seconds.
+#	# values  : n > 0
+#	# default : taken for /sys/block/sd<x>/device/timeout
+#	checker_timeout 60
+#
 #}
 #	
 ##
--- multipath-tools/libmultipath/discovery.c	2010/01/27 17:21:48	1.32.2.12
+++ multipath-tools/libmultipath/discovery.c	2010/01/27 22:33:29	1.32.2.13
@@ -262,7 +262,7 @@
 	if (r != 1)
 		return 1;
 
-	*timeout = t;
+	*timeout = t * 1000;
 	return 0;
 out:
 	sysfs_close_attribute(attr);
--- multipath-tools/libmultipath/propsel.c	2010/01/27 16:46:48	1.11.2.4
+++ multipath-tools/libmultipath/propsel.c	2010/01/27 22:33:29	1.11.2.5
@@ -235,16 +235,16 @@
 		pp->dev, checker_name(c));
 out:
 	if (conf->checker_timeout) {
-		c->timeout = conf->checker_timeout;
-		condlog(3, "%s: checker timeout = %u (config file default)",
+		c->timeout = conf->checker_timeout * 1000;
+		condlog(3, "%s: checker timeout = %u ms (config file default)",
 			pp->dev, c->timeout);
 	}
 	else if (sysfs_get_timeout(sysfs_path, pp->dev, &c->timeout) == 0)
-		condlog(3, "%s: checker timeout = %u (sysfs setting)",
+		condlog(3, "%s: checker timeout = %u ms (sysfs setting)",
 			pp->dev, c->timeout);
 	else {
 		c->timeout = DEF_TIMEOUT;
-		condlog(3, "%s: checker timeout = %u (internal default)",
+		condlog(3, "%s: checker timeout = %u ms (internal default)",
 			pp->dev, c->timeout);
 	}
 	return 0;

^ permalink raw reply	[flat|nested] 7+ messages in thread

* multipath-tools ./multipath.conf.annotated lib ...
@ 2009-04-29  4:41 bmarzins
  0 siblings, 0 replies; 7+ messages in thread
From: bmarzins @ 2009-04-29  4:41 UTC (permalink / raw)
  To: dm-cvs, dm-devel

CVSROOT:	/cvs/dm
Module name:	multipath-tools
Branch: 	RHEL5_FC6
Changes by:	bmarzins@sourceware.org	2009-04-29 04:41:33

Modified files:
	.              : multipath.conf.annotated 
	libmultipath   : config.c defaults.h dict.c 

Log message:
	Fix for bz #471854
	Port of Hannes Reinecke's verbosity patch from 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.10&r2=1.18.2.11
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.19.2.7&r2=1.19.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/defaults.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.7&r2=1.7.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/dict.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.17.2.9&r2=1.17.2.10

--- multipath-tools/multipath.conf.annotated	2009/01/16 22:47:31	1.18.2.10
+++ multipath-tools/multipath.conf.annotated	2009/04/29 04:41:32	1.18.2.11
@@ -16,6 +16,16 @@
 #	udev_dir	/dev
 #
 #	#
+#	# name    : verbosity
+#	# scope   : multipath & multipathd
+#	# desc    : The verbosity level of the command. It can be overridden by
+#	#           the -v command line option.
+#	# values  : 0-6
+#	# default : 2
+#	#
+#	verbosity 3
+#
+#	#
 #	# name    : polling_interval
 #	# scope   : multipathd
 #	# desc    : interval between two path checks in seconds
--- multipath-tools/libmultipath/config.c	2008/09/04 20:09:48	1.19.2.7
+++ multipath-tools/libmultipath/config.c	2009/04/29 04:41:33	1.19.2.8
@@ -407,7 +407,7 @@
 	 * internal defaults
 	 */
 	if (!conf->verbosity)
-		conf->verbosity = 2;
+		conf->verbosity = DEFAULT_VERBOSITY;
 
 	conf->dev_type = DEV_NONE;
 	conf->minio = 1000;
--- multipath-tools/libmultipath/defaults.h	2006/06/06 18:32:43	1.7
+++ multipath-tools/libmultipath/defaults.h	2009/04/29 04:41:33	1.7.2.1
@@ -11,6 +11,7 @@
 #define DEFAULT_NO_PATH_RETRY  NO_PATH_RETRY_UNDEF
 #define DEFAULT_PGTIMEOUT      -PGTIMEOUT_NONE
 #define DEFAULT_USER_FRIENDLY_NAMES    0
+#define DEFAULT_VERBOSITY      2
 
 #define DEFAULT_CHECKINT	5
 #define MAX_CHECKINT(a)		(a << 2)
--- multipath-tools/libmultipath/dict.c	2008/12/02 20:24:24	1.17.2.9
+++ multipath-tools/libmultipath/dict.c	2009/04/29 04:41:33	1.17.2.10
@@ -35,6 +35,17 @@
 }
 
 static int
+verbosity_handler(vector strvec)
+{
+	char * buff;
+
+	buff = VECTOR_SLOT(strvec, 1);
+	conf->verbosity = atoi(buff);
+
+	return 0;
+}
+
+static int
 udev_dir_handler(vector strvec)
 {
 	conf->udev_dir = set_value(strvec);
@@ -1651,6 +1662,14 @@
 }
 
 static int
+snprint_def_verbosity (char * buff, int len, void * data)
+{
+	if (conf->checkint == DEFAULT_VERBOSITY)
+		return 0;
+	return snprintf(buff, len, "%i", conf->verbosity);
+}
+
+static int
 snprint_def_udev_dir (char * buff, int len, void * data)
 {
 	if (!conf->udev_dir)
@@ -1927,6 +1946,8 @@
 init_keywords(void)
 {
 	install_keyword_root("defaults", NULL);
+	install_keyword("verbosity", &verbosity_handler, &snprint_def_verbosity)
+;
 	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);

^ permalink raw reply	[flat|nested] 7+ messages in thread

* multipath-tools ./multipath.conf.annotated lib ...
@ 2009-01-16 22:47 bmarzins
  0 siblings, 0 replies; 7+ messages in thread
From: bmarzins @ 2009-01-16 22:47 UTC (permalink / raw)
  To: dm-cvs, dm-devel

CVSROOT:	/cvs/dm
Module name:	multipath-tools
Branch: 	RHEL5_FC6
Changes by:	bmarzins@sourceware.org	2009-01-16 22:47:31

Modified files:
	.              : multipath.conf.annotated 
	libmultipath   : callout.c 

Log message:
	Fix for 480048.  multipathd was not releasing fds when a fork failed in
	execute_program. Also, the error messages from execute_program were not very
	helpful. This patch fixes both

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.9&r2=1.18.2.10
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/callout.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.5&r2=1.5.2.1

--- multipath-tools/multipath.conf.annotated	2008/09/08 22:01:19	1.18.2.9
+++ multipath-tools/multipath.conf.annotated	2009/01/16 22:47:31	1.18.2.10
@@ -38,6 +38,13 @@
 #	# scope   : multipath
 #	# desc    : the default path grouping policy to apply to unspecified
 #	#           multipaths
+#	# values  : failover           = 1 path per priority group
+#	#           multibus           = all valid paths in 1 priority group
+#	#           group_by_serial    = 1 priority group per detected serial
+#	#                                number
+#	#           group_by_prio      = 1 priority group per path priority
+#	#                                value
+#	#           group_by_node_name = 1 priority group per target node name
 #	# default : failover
 #	#
 #	path_grouping_policy	multibus
@@ -47,7 +54,7 @@
 #	# scope   : multipath
 #	# desc    : the default program and args to callout to obtain a unique 
 #	#           path identifier. Absolute path required
-#	# default : /sbin/scsi_id -g -u -s
+#	# default : "/sbin/scsi_id -g -u -s /block/%n"
 #	#
 #	getuid_callout	"/sbin/scsi_id -g -u -s /block/%n"
 #
@@ -65,12 +72,23 @@
 #	# name    : path_checker
 #	# scope   : multipath & multipathd
 #	# desc    : the default method used to determine the paths' state
-#	# values  : readsector0|tur|emc_clariion|hp_sw|directio
+#	# values  : directio|tur|hp_sw|rdac|emc_clariion|readsector0|cciss_tur
 #	# default : readsector0
 #	#
 #	#path_checker	readsector0
 #
 #	#
+#	# name    : features
+#	# scope   : multipath
+#	# desc    : The default extra features of multipath devices. The
+#	#           only existing feature currently is queue_if_no_path, which
+#	#           is the same as setting no_path_retry to queue.
+#	# values  : "1 queue_if_no_path"
+#	# default : (null)
+#	#
+#	features        "1 queue_if_no_path"
+#
+#	#
 #	# name    : rr_min_io
 #	# scope   : multipath
 #	# desc    : the number of IO to route to a path before switching
@@ -258,21 +276,20 @@
 #		# name    : path_grouping_policy
 #		# scope   : multipath
 #		# desc    : path grouping policy to apply to this multipath
-#		# values  : failover, multibus, group_by_serial
+#		# values  : failover           = 1 path per priority group
+#		#           multibus           = all valid paths in 1 priority
+#		#                                group
+#		#           group_by_serial    = 1 priority group per detected
+#		#                                serial number
+#		#           group_by_prio      = 1 priority group per path
+#		#                                priority value
+#		#           group_by_node_name = 1 priority group per target
+#		#                                node name
 #		# default : failover
 #		#
 #		path_grouping_policy	multibus
 #
 #		#
-#		# name    : path_checker
-#		# scope   : multipathd
-#		# desc    : path checking alorithm to use to check path state
-#		# values  : readsector0, tur
-#		# default : readsector0
-#		#
-#		# 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
@@ -284,19 +301,29 @@
 #		#
 #		# 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.
+#		# desc    : tell the daemon to manage path group failback, or
+#		#	    or not to. 0 means immediate failback, values >0
+#		#	    means deffered failback expressed in seconds.
 #		# values  : manual|immediate|n > 0
 #		# default : manual
 #		#
 #		failback		immediate
 #
 #		#
+#		# 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
+#
+#		#
 #		# name    : no_path_retry
 #		# scope   : multipath & multipathd
-#		# desc    : tell the number of retries until disable queueing, or
-#		#           "fail" means immediate failure (no queueing),
+#		# desc    : tell the number of retries until disable queueing,
+#		#           or "fail" means immediate failure (no queueing),
 #		#           "queue" means never stop queueing
 #		# values  : queue|fail|n (>0)
 #		# default : (null)
@@ -384,11 +411,15 @@
 #		# scope   : multipath
 #		# desc    : path grouping policy to apply to multipath hosted
 #		#           by this storage controller
-#		# values  : failover        = 1 path per priority group
-#		#           multibus        = all valid paths in 1 priority
-#		#                             group
-#		#           group_by_serial = 1 priority group per detected
-#		#                             serial number
+#		# values  : failover           = 1 path per priority group
+#		#           multibus           = all valid paths in 1 priority
+#		#                                group
+#		#           group_by_serial    = 1 priority group per detected
+#		#                                serial number
+#		#           group_by_prio      = 1 priority group per path
+#		#                                priority value
+#		#           group_by_node_name = 1 priority group per target
+#		#                                node name
 #		# default : failover
 #		#
 #		path_grouping_policy	multibus
@@ -398,7 +429,7 @@
 #		# 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
+#		# default : "/sbin/scsi_id -g -u -s /block/%n"
 #		#
 #		getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
 #
@@ -417,7 +448,8 @@
 #		# name    : path_checker
 #		# scope   : multipathd
 #		# desc    : path checking alorithm to use to check path state
-#		# values  : readsector0, tur
+#		# values  : directio|tur|hp_sw|rdac|emc_clariion|readsector0|
+#		#           cciss_tur
 #		# default : readsector0
 #		#
 #		path_checker		readsector0
@@ -432,6 +464,49 @@
 #		path_selector		"round-robin 0"
 #
 #		#
+#		# name    : features
+#		# scope   : multipath
+#		# desc    : The default extra features of multipath devices. The
+#		#           only existing feature currently is queue_if_no_path,
+#		#           which is the same as setting no_path_retry to queue.
+#		# values  : "1 queue_if_no_path"
+#		# default : (null)
+#		#
+#		features        "1 queue_if_no_path"
+#
+#               #
+#               # name    : hardware_handler
+#               # scope   : multipath
+#               # desc    : If set, it specifies a module that will be used to
+#               #           perform hardware specific actions when switching
+#               #           path groups or handling IO errors
+#               # values  : "0"|"1 emc"|"1 hp-sw"|"1 rdac"
+#               # default : "0"
+#               #
+#               hardware_handler "1 emc"
+#
+#		#
+#		# 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
+#
+#		#
+#		# name    : no_path_retry
+#		# scope   : multipath & multipathd
+#		# desc    : tell the number of retries until disable queueing,
+#		#           or "fail" means immediate failure (no queueing),
+#		#           "queue" means never stop queueing
+#		# values  : queue|fail|n (>0)
+#		# default : (null)
+#		#
+#		#no_path_retry  queue
+#
+#		#
 #		# name    : failback
 #		# scope   : multipathd
 #		# desc    : tell the daemon to manage path group failback, or not to.
--- multipath-tools/libmultipath/callout.c	2006/06/06 18:32:43	1.5
+++ multipath-tools/libmultipath/callout.c	2009/01/16 22:47:31	1.5.2.1
@@ -64,9 +64,10 @@
 
 	retval = pipe(fds);
 
-	if (retval != 0)
+	if (retval != 0) {
+		condlog(0, "error creating pipe for callout: %s", strerror(errno));
 		return -1;
-
+	}
 
 	pid = fork();
 
@@ -79,9 +80,12 @@
 		dup(fds[1]);
 
 		retval = execv(argv[0], argv);
-
+		condlog(0, "error execing %s : %s", argv[0], strerror(errno));
 		exit(-1);
 	case -1:
+		condlog(0, "fork failed: %s", strerror(errno));
+		close(fds[0]);
+		close(fds[1]);
 		return -1;
 	default:
 		/* parent reads from fds[0] */
@@ -95,13 +99,16 @@
 
 			i += count;
 			if (i >= len-1) {
+				condlog(0, "not enough space for response from %s", argv[0]);
 				retval = -1;
 				break;
 			}
 		}
 
-		if (count < 0)
+		if (count < 0) {
+			condlog(0, "no response from %s", argv[0]);
 			retval = -1;
+		}
 
 		if (i > 0 && value[i-1] == '\n')
 			i--;
@@ -110,8 +117,18 @@
 		wait(&status);
 		close(fds[0]);
 
-		if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0))
-			retval = -1;
+		retval = -1;
+		if (WIFEXITED(status)) {
+			status = WEXITSTATUS(status);
+			if (status == 0)
+				retval = 0;
+			else
+				condlog(0, "%s exitted with %d", argv[0], status);
+		}
+		else if (WIFSIGNALED(status))
+			condlog(0, "%s was terminated by signal %d", argv[0], WTERMSIG(status));
+		else
+			condlog(0, "%s terminated abnormally", argv[0]);
 	}
 	return retval;
 }

^ permalink raw reply	[flat|nested] 7+ messages in thread

* multipath-tools ./multipath.conf.annotated lib ...
@ 2009-01-16 21:30 bmarzins
  0 siblings, 0 replies; 7+ messages in thread
From: bmarzins @ 2009-01-16 21:30 UTC (permalink / raw)
  To: dm-cvs, dm-devel

CVSROOT:	/cvs/dm
Module name:	multipath-tools
Branch: 	RHEL4_FC5
Changes by:	bmarzins@sourceware.org	2009-01-16 21:30:43

Modified files:
	.              : multipath.conf.annotated 
	libmultipath   : dict.c 

Log message:
	Fix fox bz #453547.  Fix rr_min_io for devices/maps in multipath.conf

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.6&r2=1.16.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/dict.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1=1.16.2.5&r2=1.16.2.6

--- multipath-tools/multipath.conf.annotated	2008/04/14 22:40:08	1.16.2.6
+++ multipath-tools/multipath.conf.annotated	2009/01/16 21:30:42	1.16.2.7
@@ -265,6 +265,14 @@
 #		path_selector		"round-robin 0"
 #
 #		#
+#		# name    : rr_min_io
+#		# scope   : multipath
+#		# desc    : the number of IO to route to a path before switching
+#		#           to the next in the same path group
+#		#
+#		rr_min_io	100
+#
+#		#
 #		# name    : failback
 #		# scope   : multipathd
 #		# desc    : tell the daemon to manage path group failback, or
@@ -403,6 +411,14 @@
 #		path_selector		"round-robin 0"
 #
 #		#
+#		# name    : rr_min_io
+#		# scope   : multipath
+#		# desc    : the number of IO to route to a path before switching
+#		#           to the next in the same path group
+#		#
+#		rr_min_io	100
+#
+#		#
 #		# name    : path_checker
 #		# scope   : multipathd
 #		# desc    : path checking alorithm to use to check path state
--- multipath-tools/libmultipath/dict.c	2008/04/14 22:40:08	1.16.2.5
+++ multipath-tools/libmultipath/dict.c	2009/01/16 21:30:43	1.16.2.6
@@ -556,6 +556,26 @@
 }
 
 static int
+hw_rr_min_io_handler(vector strvec)
+{
+	char * buff;
+	struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
+
+	if (!hwe)
+		return 1;
+
+	buff = set_value(strvec);
+
+	if (!buff)
+		return 1;
+	
+	hwe->rr_min_io = atoi(buff);
+	FREE(buff);
+
+	return 0;
+}
+
+static int
 hw_features_handler(vector strvec)
 {
 	struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
@@ -830,6 +850,26 @@
 	return 0;
 }
 
+
+static int
+mp_rr_min_io_handler(vector strvec)
+{
+	char * buff;
+	struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable);
+
+	if (!mpe)
+		return 1;
+
+	buff = set_value(strvec);
+
+	if (!buff)
+		return 1;
+	
+	mpe->rr_min_io = atoi(buff);
+	FREE(buff);
+
+	return 0;
+}
 static int
 mp_failback_handler(vector strvec)
 {
@@ -1087,6 +1127,7 @@
 	install_keyword("getuid_callout", &hw_getuid_callout_handler);
 	install_keyword("path_selector", &hw_selector_handler);
 	install_keyword("path_checker", &hw_path_checker_handler);
+	install_keyword("rr_min_io", &hw_rr_min_io_handler);
 	install_keyword("features", &hw_features_handler);
 	install_keyword("hardware_handler", &hw_handler_handler);
 	install_keyword("prio_callout", &prio_callout_handler);
@@ -1104,6 +1145,7 @@
 	install_keyword("alias", &alias_handler);
 	install_keyword("path_grouping_policy", &mp_pgpolicy_handler);
 	install_keyword("path_selector", &mp_selector_handler);
+	install_keyword("rr_min_io", &mp_rr_min_io_handler);
 	install_keyword("failback", &mp_failback_handler);
 	install_keyword("rr_weight", &mp_weight_handler);
 	install_keyword("no_path_retry", &mp_no_path_retry_handler);

^ permalink raw reply	[flat|nested] 7+ messages in thread

* multipath-tools ./multipath.conf.annotated lib ...
@ 2008-08-29 21:30 bmarzins
  0 siblings, 0 replies; 7+ messages in thread
From: bmarzins @ 2008-08-29 21:30 UTC (permalink / raw)
  To: dm-cvs, dm-devel

CVSROOT:	/cvs/dm
Module name:	multipath-tools
Branch: 	RHEL5_FC6
Changes by:	bmarzins@sourceware.org	2008-08-29 21:30:34

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

Log message:
	Fix for bz #457226. The kernel doesn't allow "ulimit -n unlimited" because
	you can't set the max number of open fds greater than NR_OPEN.  So multipath's
	max_fds config option now allows the value "max" instead of "unlimited", which
	sets the max open fds to NR_OPEN.

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.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.5&r2=1.17.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.3&r2=1.18.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.8&r2=1.69.2.9

--- multipath-tools/multipath.conf.annotated	2008/08/25 20:59:05	1.18.2.6
+++ multipath-tools/multipath.conf.annotated	2008/08/29 21:30:34	1.18.2.7
@@ -84,7 +84,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/libmultipath/dict.c	2008/08/25 20:59:06	1.17.2.5
+++ multipath-tools/libmultipath/dict.c	2008/08/29 21:30:34	1.17.2.6
@@ -155,8 +155,8 @@
 		return 1;
 
 	if (strlen(buff) == 9 &&
-	    !strcmp(buff, "unlimited"))
-		conf->max_fds = MAX_FDS_UNLIMITED;
+	    !strcmp(buff, "max"))
+		conf->max_fds = MAX_FDS_MAX;
 	else
 		conf->max_fds = atoi(buff);
 	FREE(buff);
@@ -1653,8 +1653,8 @@
 	if (!conf->max_fds)
 		return 0;
 
-	if (conf->max_fds < 0)
-		return snprintf(buff, len, "unlimited");	
+	if (conf->max_fds == MAX_FDS_MAX)
+		return snprintf(buff, len, "max");	
 	return snprintf(buff, len, "%d", conf->max_fds);
 }
 
--- multipath-tools/libmultipath/structs.h	2008/08/25 20:59:06	1.18.2.3
+++ multipath-tools/libmultipath/structs.h	2008/08/29 21:30:34	1.18.2.4
@@ -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/08/27 19:14:58	1.69.2.8
+++ multipath-tools/multipathd/main.c	2008/08/29 21:30:34	1.69.2.9
@@ -1479,14 +1479,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\n",
 				conf->max_fds, strerror(errno));

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-02-18 18:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-08 19:31 multipath-tools ./multipath.conf.annotated lib bmarzins
  -- strict thread matches above, loose matches on Subject: below --
2011-02-18 18:27 bmarzins
2010-01-27 22:33 bmarzins
2009-04-29  4:41 bmarzins
2009-01-16 22:47 bmarzins
2009-01-16 21:30 bmarzins
2008-08-29 21:30 bmarzins

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.