* multipath-tools libcheckers/tur.c libmultipath ...
@ 2009-04-21 0:05 bmarzins
2009-04-21 17:43 ` Benjamin Marzinski
0 siblings, 1 reply; 4+ messages in thread
From: bmarzins @ 2009-04-21 0:05 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-21 00:05:24
Modified files:
libcheckers : tur.c
libmultipath : discovery.c discovery.h
multipathd : main.c
path_priority/pp_alua: rtpg.c
Log message:
Fix for bz 472451. This fixes two issues. First, it keeps multipathd from checking
scsi paths in the "blocked" state, since multipathd will just hang until the device
times out. Second, the tur checker retrys on a few more error codes that could happen
during transient path failures.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libcheckers/tur.c.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/libmultipath/discovery.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.32.2.6&r2=1.32.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/discovery.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.14.2.1&r2=1.14.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.18&r2=1.69.2.19
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/path_priority/pp_alua/rtpg.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.3.2.1&r2=1.3.2.2
--- multipath-tools/libcheckers/tur.c 2008/08/25 21:43:54 1.4.2.1
+++ multipath-tools/libcheckers/tur.c 2009/04/21 00:05:22 1.4.2.2
@@ -23,6 +23,11 @@
#define MSG_TUR_UP "tur checker reports path is up"
#define MSG_TUR_DOWN "tur checker reports path is down"
+/* from linux/include/scsi/scsi.h */
+#define DID_BUS_BUSY 0x02
+#define DID_ERROR 0x07
+#define DID_TRANSPORT_DISRUPTED 0x0e
+
struct tur_checker_context {
void * dummy;
};
@@ -62,6 +67,12 @@
if (io_hdr.info & SG_INFO_OK_MASK) {
int key = 0, asc, ascq;
+ if (io_hdr.host_status == DID_BUS_BUSY ||
+ io_hdr.host_status == DID_ERROR ||
+ io_hdr.host_status == DID_TRANSPORT_DISRUPTED) {
+ if (--retry_tur)
+ goto retry;
+ }
if (io_hdr.sb_len_wr > 3) {
if (io_hdr.sbp[0] == 0x72 || io_hdr.sbp[0] == 0x73) {
key = io_hdr.sbp[1] & 0x0f;
--- multipath-tools/libmultipath/discovery.c 2008/01/15 01:34:36 1.32.2.6
+++ multipath-tools/libmultipath/discovery.c 2009/04/21 00:05:22 1.32.2.7
@@ -235,6 +235,7 @@
declare_sysfs_get_str(rev, "%s/block/%s/device/rev");
declare_sysfs_get_str(dev, "%s/block/%s/dev");
declare_sysfs_get_str(bustype, "%s/block/%s/device/bus");
+declare_sysfs_get_str(state, "%s/block/%s/device/state");
int
sysfs_get_size (char * sysfs_path, char * dev, unsigned long long * size)
--- multipath-tools/libmultipath/discovery.h 2007/06/18 17:37:18 1.14.2.1
+++ multipath-tools/libmultipath/discovery.h 2009/04/21 00:05:23 1.14.2.2
@@ -30,7 +30,7 @@
int sysfs_get_rev (char * sysfs_path, char * dev, char * buff, int len);
int sysfs_get_dev (char * sysfs_path, char * dev, char * buff, int len);
int sysfs_get_bustype (char * sysfs_path, char * dev, char * buff, int len);
-
+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 path_discovery (vector pathvec, struct config * conf, int flag);
--- multipath-tools/multipathd/main.c 2009/04/06 16:50:43 1.69.2.18
+++ multipath-tools/multipathd/main.c 2009/04/21 00:05:23 1.69.2.19
@@ -907,6 +907,22 @@
}
}
+int
+check_sysfs_state (struct path *pp, int *newstate)
+{
+ char state[32];
+ if (pp->bus != SYSFS_BUS_SCSI)
+ return 0;
+ if (sysfs_get_state(sysfs_path, pp->dev, state, 32) != 0)
+ return 0;
+ condlog(3, "%s: state = %s", pp->dev, state);
+ if (strncmp(state, "blocked", 7) == 0){
+ *newstate = PATH_PENDING;
+ return 1;
+ }
+ return 0;
+}
+
static void *
checkerloop (void *ap)
{
@@ -963,7 +979,8 @@
*/
checker_set_async(&pp->checker);
- newstate = checker_check(&pp->checker);
+ if (check_sysfs_state(pp, &newstate) == 0)
+ newstate = checker_check(&pp->checker);
if (newstate < 0) {
condlog(2, "%s: unusable path", pp->dev);
--- multipath-tools/path_priority/pp_alua/rtpg.c 2009/04/08 21:38:44 1.3.2.1
+++ multipath-tools/path_priority/pp_alua/rtpg.c 2009/04/21 00:05:24 1.3.2.2
@@ -268,7 +268,7 @@
}
rc = do_rtpg(fd, buf, buflen);
if (rc < 0)
- return rc;
+ goto out;
scsi_buflen = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
if (buflen < (scsi_buflen + 4)) {
free(buf);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: multipath-tools libcheckers/tur.c libmultipath ...
2009-04-21 0:05 bmarzins
@ 2009-04-21 17:43 ` Benjamin Marzinski
0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Marzinski @ 2009-04-21 17:43 UTC (permalink / raw)
To: device-mapper development, Christophe Varoqui
On Tue, Apr 21, 2009 at 12:05:25AM -0000, bmarzins@sourceware.org wrote:
> CVSROOT: /cvs/dm
> Module name: multipath-tools
> Branch: RHEL5_FC6
> Changes by: bmarzins@sourceware.org 2009-04-21 00:05:24
>
> Modified files:
> libcheckers : tur.c
> libmultipath : discovery.c discovery.h
> multipathd : main.c
> path_priority/pp_alua: rtpg.c
>
> Log message:
> Fix for bz 472451. This fixes two issues. First, it keeps multipathd from checking
> scsi paths in the "blocked" state, since multipathd will just hang until the device
> times out. Second, the tur checker retrys on a few more error codes that could happen
> during transient path failures.
>
Is there any interest having this upstream in 0.4.9, given that the
path checking method is going to be changing? I'm not sure how soon all
of those changes will be in place. Christophe, if you want me to port
this upstream, just let me know.
-Ben
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: multipath-tools libcheckers/tur.c libmultipath ...
[not found] <2140769529.3263291240345156061.JavaMail.root@zimbra16-e3.priv.proxad.net>
@ 2009-04-21 20:23 ` christophe.varoqui
0 siblings, 0 replies; 4+ messages in thread
From: christophe.varoqui @ 2009-04-21 20:23 UTC (permalink / raw)
To: Benjamin Marzinski; +Cc: device-mapper development
> Is there any interest having this upstream in 0.4.9, given that the
> path checking method is going to be changing? I'm not sure how soon all
> of those changes will be in place. Christophe, if you want me to port
> this upstream, just let me know.
Yes, the sysfs bdev state checking has appeal.
Thank you for proposing.
^ permalink raw reply [flat|nested] 4+ messages in thread
* multipath-tools libcheckers/tur.c libmultipath ...
@ 2009-06-08 21:38 bmarzins
0 siblings, 0 replies; 4+ messages in thread
From: bmarzins @ 2009-06-08 21:38 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2009-06-08 21:38:02
Modified files:
libcheckers : tur.c
libmultipath : discovery.c
Log message:
Fix for 473039. TUR checker can now return PATH_GHOST. Already upstream.
More work for 437588.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libcheckers/tur.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.4.2.2&r2=1.4.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/discovery.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.32.2.7&r2=1.32.2.8
--- multipath-tools/libcheckers/tur.c 2009/04/21 00:05:22 1.4.2.2
+++ multipath-tools/libcheckers/tur.c 2009/06/08 21:38:01 1.4.2.3
@@ -21,6 +21,7 @@
#define HEAVY_CHECK_COUNT 10
#define MSG_TUR_UP "tur checker reports path is up"
+#define MSG_TUR_GHOST "tur checker reports path in standby state"
#define MSG_TUR_DOWN "tur checker reports path is down"
/* from linux/include/scsi/scsi.h */
@@ -91,6 +92,17 @@
if (--retry_tur)
goto retry;
}
+ else if( key == 0x2){
+ /* Not Ready */
+
+ /*Note : Other ALUA states are either UP or DOWN*/
+ if( asc == 0x04 && ascq == 0x0b){
+ /*LOGICAL UNIT NOT ACCESSIBLE, TARGET PORT IN STANDBY STATE*/
+ MSG(c, MSG_TUR_GHOST);
+ return PATH_GHOST;
+ }
+ }
+
MSG(c, MSG_TUR_DOWN);
return PATH_DOWN;
}
--- multipath-tools/libmultipath/discovery.c 2009/04/21 00:05:22 1.32.2.7
+++ multipath-tools/libmultipath/discovery.c 2009/06/08 21:38:02 1.32.2.8
@@ -742,12 +742,34 @@
}
static int
+get_uid (struct path * pp)
+{
+ char buff[CALLOUT_MAX_SIZE];
+
+ if (!pp->getuid)
+ select_getuid(pp);
+
+ if (apply_format(pp->getuid, &buff[0], pp)) {
+ condlog(0, "error formatting uid callout command");
+ memset(pp->wwid, 0, WWID_SIZE);
+ } else if (execute_program(buff, pp->wwid, WWID_SIZE)) {
+ condlog(0, "error calling out %s", buff);
+ memset(pp->wwid, 0, WWID_SIZE);
+ return 1;
+ }
+ condlog(3, "%s: uid = %s (callout)", pp->dev ,pp->wwid);
+ return 0;
+}
+
+static int
get_prio (struct path * pp)
{
char buff[CALLOUT_MAX_SIZE];
char prio[16];
if (!pp->getprio_selected) {
+ if (!strlen(pp->wwid))
+ get_uid(pp);
select_getprio(pp);
pp->getprio_selected = 1;
}
@@ -768,26 +790,6 @@
return 0;
}
-static int
-get_uid (struct path * pp)
-{
- char buff[CALLOUT_MAX_SIZE];
-
- if (!pp->getuid)
- select_getuid(pp);
-
- if (apply_format(pp->getuid, &buff[0], pp)) {
- condlog(0, "error formatting uid callout command");
- memset(pp->wwid, 0, WWID_SIZE);
- } else if (execute_program(buff, pp->wwid, WWID_SIZE)) {
- condlog(0, "error calling out %s", buff);
- memset(pp->wwid, 0, WWID_SIZE);
- return 1;
- }
- condlog(3, "%s: uid = %s (callout)", pp->dev ,pp->wwid);
- return 0;
-}
-
extern int
pathinfo (struct path *pp, vector hwtable, int mask)
{
@@ -815,12 +817,12 @@
if (mask & DI_CHECKER && get_state(pp))
goto blank;
- if (mask & DI_PRIO && pp->state != PATH_DOWN)
- get_prio(pp);
-
if (mask & DI_WWID && !strlen(pp->wwid))
get_uid(pp);
+ if (mask & DI_PRIO && pp->state != PATH_DOWN)
+ get_prio(pp);
+
#ifndef DAEMON
close(pp->fd);
pp->fd = -1;
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-06-08 21:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-08 21:38 multipath-tools libcheckers/tur.c libmultipath bmarzins
[not found] <2140769529.3263291240345156061.JavaMail.root@zimbra16-e3.priv.proxad.net>
2009-04-21 20:23 ` christophe.varoqui
-- strict thread matches above, loose matches on Subject: below --
2009-04-21 0:05 bmarzins
2009-04-21 17:43 ` Benjamin Marzinski
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.