From patchwork Mon Jun 8 21:38:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bmarzins@sourceware.org X-Patchwork-Id: 28760 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n58LcVs7031483 for ; Mon, 8 Jun 2009 21:38:32 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id D1F67619C1B; Mon, 8 Jun 2009 17:38:30 -0400 (EDT) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n58LcT9Y013173 for ; Mon, 8 Jun 2009 17:38:29 -0400 Received: from mx3.redhat.com (mx3.redhat.com [172.16.48.32]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n58LcSwe014795 for ; Mon, 8 Jun 2009 17:38:28 -0400 Received: from sourceware.org (sourceware.org [209.132.176.174]) by mx3.redhat.com (8.13.8/8.13.8) with SMTP id n58Lc3T1021360 for ; Mon, 8 Jun 2009 17:38:03 -0400 Received: (qmail 2790 invoked by uid 9475); 8 Jun 2009 21:38:02 -0000 Date: 8 Jun 2009 21:38:02 -0000 Message-ID: <20090608213802.2788.qmail@sourceware.org> From: bmarzins@sourceware.org To: dm-cvs@sourceware.org, dm-devel@redhat.com X-RedHat-Spam-Score: -3.952 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Scanned-By: MIMEDefang 2.63 on 172.16.48.32 X-loop: dm-devel@redhat.com Cc: Subject: [dm-devel] multipath-tools libcheckers/tur.c libmultipath ... X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com 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 --- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel --- 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;