From patchwork Thu Feb 14 14:17:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 2142181 Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by patchwork1.kernel.org (Postfix) with ESMTP id B27DB3FCFC for ; Thu, 14 Feb 2013 15:29:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r1EFQguX001334; Thu, 14 Feb 2013 10:26:43 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r1EEHXgg019865 for ; Thu, 14 Feb 2013 09:17:33 -0500 Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.20]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r1EEHXUp007709 for ; Thu, 14 Feb 2013 09:17:33 -0500 Received: from georges.telenet-ops.be (georges.telenet-ops.be [195.130.137.68]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1EEHUOo010185 for ; Thu, 14 Feb 2013 09:17:31 -0500 Received: from [192.168.1.101] ([178.119.235.68]) by georges.telenet-ops.be with bizsmtp id 0EHV1l00k1VD9XW06EHVoL; Thu, 14 Feb 2013 15:17:29 +0100 Message-ID: <511CF1F8.4040100@acm.org> Date: Thu, 14 Feb 2013 15:17:28 +0100 From: Bart Van Assche User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2 MIME-Version: 1.0 To: dm-devel@redhat.com X-RedHat-Spam-Score: -2.311 (BAYES_00, DCC_REPUT_00_12, RCVD_IN_DNSWL_NONE, SPF_PASS) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.20 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Thu, 14 Feb 2013 10:26:40 -0500 Subject: [dm-devel] [PATCH for multipath-tools] Handle SCSI device states "quiesce" and "transport-offline" properly X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 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 Signed-off-by: Bart Van Assche Reviewed-by: Mike Christie --- libmultipath/discovery.c | 5 +++-- libmultipath/structs.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 3fbc181..0b5fd1d 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -797,12 +797,13 @@ path_offline (struct path * pp) condlog(3, "%s: path state = %s", pp->dev, buff); - if (!strncmp(buff, "offline", 7)) { + if (!strncmp(buff, "offline", 7) || + !strncmp(buff, "transport-offline", 17)) { pp->offline = 1; return PATH_DOWN; } pp->offline = 0; - if (!strncmp(buff, "blocked", 7)) + if (!strncmp(buff, "blocked", 7) || !strncmp(buff, "quiesce", 7)) return PATH_PENDING; else if (!strncmp(buff, "running", 7)) return PATH_UP; diff --git a/libmultipath/structs.h b/libmultipath/structs.h index ab05a78..b9ace36 100644 --- a/libmultipath/structs.h +++ b/libmultipath/structs.h @@ -20,7 +20,7 @@ #define SCSI_VENDOR_SIZE 9 #define SCSI_PRODUCT_SIZE 17 #define SCSI_REV_SIZE 5 -#define SCSI_STATE_SIZE 9 +#define SCSI_STATE_SIZE 19 #define NO_PATH_RETRY_UNDEF 0 #define NO_PATH_RETRY_FAIL -1