Blame SOURCES/0088-RHBZ-1069811-configurable-prio-timeout.patch

4ae388
---
4ae388
 libmultipath/prio.c                   |    7 +++++++
4ae388
 libmultipath/prio.h                   |    1 +
4ae388
 libmultipath/prioritizers/alua_rtpg.c |    5 +++--
4ae388
 libmultipath/prioritizers/emc.c       |    2 +-
4ae388
 libmultipath/prioritizers/hds.c       |    2 +-
4ae388
 libmultipath/prioritizers/hp_sw.c     |    2 +-
4ae388
 libmultipath/prioritizers/ontap.c     |    4 ++--
4ae388
 libmultipath/prioritizers/rdac.c      |    2 +-
4ae388
 multipath.conf.annotated              |    5 +++--
4ae388
 multipath/multipath.conf.5            |    4 ++--
4ae388
 10 files changed, 22 insertions(+), 12 deletions(-)
4ae388
4ae388
Index: multipath-tools-130222/libmultipath/prio.c
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/libmultipath/prio.c
4ae388
+++ multipath-tools-130222/libmultipath/prio.c
4ae388
@@ -10,6 +10,13 @@
4ae388
 
4ae388
 static LIST_HEAD(prioritizers);
4ae388
 
4ae388
+unsigned int get_prio_timeout(unsigned int default_timeout)
4ae388
+{
4ae388
+	if (conf->checker_timeout)
4ae388
+		return conf->checker_timeout * 1000;
4ae388
+	return default_timeout;
4ae388
+}
4ae388
+
4ae388
 int init_prio (void)
4ae388
 {
4ae388
 	if (!add_prio(DEFAULT_PRIO))
4ae388
Index: multipath-tools-130222/libmultipath/prio.h
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/libmultipath/prio.h
4ae388
+++ multipath-tools-130222/libmultipath/prio.h
4ae388
@@ -51,6 +51,7 @@ struct prio {
4ae388
 	int (*getprio)(struct path *, char *);
4ae388
 };
4ae388
 
4ae388
+unsigned int get_prio_timeout(unsigned int default_timeout);
4ae388
 int init_prio (void);
4ae388
 void cleanup_prio (void);
4ae388
 struct prio * add_prio (char *);
4ae388
Index: multipath-tools-130222/libmultipath/prioritizers/alua_rtpg.c
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/libmultipath/prioritizers/alua_rtpg.c
4ae388
+++ multipath-tools-130222/libmultipath/prioritizers/alua_rtpg.c
4ae388
@@ -21,6 +21,7 @@
4ae388
 #define __user
4ae388
 #include <scsi/sg.h>
4ae388
 
4ae388
+#include "../prio.h"
4ae388
 #include "alua_rtpg.h"
4ae388
 
4ae388
 #define SENSE_BUFF_LEN  32
4ae388
@@ -134,7 +135,7 @@ do_inquiry(int fd, int evpd, unsigned in
4ae388
 	hdr.dxfer_len		= resplen;
4ae388
 	hdr.sbp			= sense;
4ae388
 	hdr.mx_sb_len		= sizeof(sense);
4ae388
-	hdr.timeout		= DEF_TIMEOUT;
4ae388
+	hdr.timeout		= get_prio_timeout(DEF_TIMEOUT);
4ae388
 
4ae388
 	if (ioctl(fd, SG_IO, &hdr) < 0) {
4ae388
 		PRINT_DEBUG("do_inquiry: IOCTL failed!\n");
4ae388
@@ -253,7 +254,7 @@ do_rtpg(int fd, void* resp, long resplen
4ae388
 	hdr.dxfer_len		= resplen;
4ae388
 	hdr.mx_sb_len		= sizeof(sense);
4ae388
 	hdr.sbp			= sense;
4ae388
-	hdr.timeout		= DEF_TIMEOUT;
4ae388
+	hdr.timeout		= get_prio_timeout(DEF_TIMEOUT);
4ae388
 
4ae388
 	if (ioctl(fd, SG_IO, &hdr) < 0)
4ae388
 		return -RTPG_RTPG_FAILED;
4ae388
Index: multipath-tools-130222/libmultipath/prioritizers/emc.c
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/libmultipath/prioritizers/emc.c
4ae388
+++ multipath-tools-130222/libmultipath/prioritizers/emc.c
4ae388
@@ -31,7 +31,7 @@ int emc_clariion_prio(const char *dev, i
4ae388
 	io_hdr.dxferp = sense_buffer;
4ae388
 	io_hdr.cmdp = inqCmdBlk;
4ae388
 	io_hdr.sbp = sb;
4ae388
-	io_hdr.timeout = 60000;
4ae388
+	io_hdr.timeout = get_prio_timeout(60000);
4ae388
 	io_hdr.pack_id = 0;
4ae388
 	if (ioctl(fd, SG_IO, &io_hdr) < 0) {
4ae388
 		pp_emc_log(0, "sending query command failed");
4ae388
Index: multipath-tools-130222/libmultipath/prioritizers/hds.c
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/libmultipath/prioritizers/hds.c
4ae388
+++ multipath-tools-130222/libmultipath/prioritizers/hds.c
4ae388
@@ -114,7 +114,7 @@ int hds_modular_prio (const char *dev, i
4ae388
 	io_hdr.dxferp = inqBuff;
4ae388
 	io_hdr.cmdp = inqCmdBlk;
4ae388
 	io_hdr.sbp = sense_buffer;
4ae388
-	io_hdr.timeout = 2000;	/* TimeOut = 2 seconds */
4ae388
+	io_hdr.timeout = get_prio_timeout(2000); /* TimeOut = 2 seconds */
4ae388
 
4ae388
 	if (ioctl (fd, SG_IO, &io_hdr) < 0) {
4ae388
 		pp_hds_log(0, "SG_IO error");
4ae388
Index: multipath-tools-130222/libmultipath/prioritizers/hp_sw.c
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/libmultipath/prioritizers/hp_sw.c
4ae388
+++ multipath-tools-130222/libmultipath/prioritizers/hp_sw.c
4ae388
@@ -46,7 +46,7 @@ int hp_sw_prio(const char *dev, int fd)
4ae388
 	io_hdr.dxfer_direction = SG_DXFER_NONE;
4ae388
 	io_hdr.cmdp = turCmdBlk;
4ae388
 	io_hdr.sbp = sb;
4ae388
-	io_hdr.timeout = 60000;
4ae388
+	io_hdr.timeout = get_prio_timeout(60000);
4ae388
 	io_hdr.pack_id = 0;
4ae388
  retry:
4ae388
 	if (ioctl(fd, SG_IO, &io_hdr) < 0) {
4ae388
Index: multipath-tools-130222/libmultipath/prioritizers/ontap.c
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/libmultipath/prioritizers/ontap.c
4ae388
+++ multipath-tools-130222/libmultipath/prioritizers/ontap.c
4ae388
@@ -89,7 +89,7 @@ static int send_gva(const char *dev, int
4ae388
 	io_hdr.dxferp = results;
4ae388
 	io_hdr.cmdp = cdb;
4ae388
 	io_hdr.sbp = sb;
4ae388
-	io_hdr.timeout = SG_TIMEOUT;
4ae388
+	io_hdr.timeout = get_prio_timeout(SG_TIMEOUT);
4ae388
 	io_hdr.pack_id = 0;
4ae388
 	if (ioctl(fd, SG_IO, &io_hdr) < 0) {
4ae388
 		pp_ontap_log(0, "SG_IO ioctl failed, errno=%d", errno);
4ae388
@@ -141,7 +141,7 @@ static int get_proxy(const char *dev, in
4ae388
 	io_hdr.dxferp = results;
4ae388
 	io_hdr.cmdp = cdb;
4ae388
 	io_hdr.sbp = sb;
4ae388
-	io_hdr.timeout = SG_TIMEOUT;
4ae388
+	io_hdr.timeout = get_prio_timeout(SG_TIMEOUT);
4ae388
 	io_hdr.pack_id = 0;
4ae388
 	if (ioctl(fd, SG_IO, &io_hdr) < 0) {
4ae388
 		pp_ontap_log(0, "ioctl sending inquiry command failed, "
4ae388
Index: multipath-tools-130222/libmultipath/prioritizers/rdac.c
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/libmultipath/prioritizers/rdac.c
4ae388
+++ multipath-tools-130222/libmultipath/prioritizers/rdac.c
4ae388
@@ -31,7 +31,7 @@ int rdac_prio(const char *dev, int fd)
4ae388
 	io_hdr.dxferp = sense_buffer;
4ae388
 	io_hdr.cmdp = inqCmdBlk;
4ae388
 	io_hdr.sbp = sb;
4ae388
-	io_hdr.timeout = 60000;
4ae388
+	io_hdr.timeout = get_prio_timeout(60000);
4ae388
 	io_hdr.pack_id = 0;
4ae388
 	if (ioctl(fd, SG_IO, &io_hdr) < 0) {
4ae388
 		pp_rdac_log(0, "sending inquiry command failed");
4ae388
Index: multipath-tools-130222/multipath.conf.annotated
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/multipath.conf.annotated
4ae388
+++ multipath-tools-130222/multipath.conf.annotated
4ae388
@@ -188,8 +188,9 @@
4ae388
 #	#
4ae388
 #	# name    : checker_timeout
4ae388
 #	# scope   : multipath & multipathd
4ae388
-#	# desc    : The timeout to use for path checkers that issue scsi
4ae388
-#	#           commands with an explicit timeout, in seconds.
4ae388
+#	# desc    : The timeout to use for path checkers and prioritizers
4ae388
+#	#           that issue scsi commands with an explicit timeout, in
4ae388
+#	#           seconds.
4ae388
 #	# values  : n > 0
4ae388
 #	# default : taken from /sys/block/sd<x>/device/timeout
4ae388
 #	checker_timeout 60
4ae388
Index: multipath-tools-130222/multipath/multipath.conf.5
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/multipath/multipath.conf.5
4ae388
+++ multipath-tools-130222/multipath/multipath.conf.5
4ae388
@@ -321,8 +321,8 @@ maximum number of open fds is taken from
4ae388
 if that number is greated than 1024.
4ae388
 .TP
4ae388
 .B checker_timeout
4ae388
-Specify the timeout to user for path checkers that issue scsi commands with an
4ae388
-explicit timeout, in seconds; default taken from
4ae388
+Specify the timeout to use for path checkers and prioritizers that issue scsi
4ae388
+commands with an explicit timeout, in seconds; default taken from
4ae388
 .I /sys/block/sd<x>/device/timeout
4ae388
 .TP
4ae388
 .B fast_io_fail_tmo