From patchwork Fri Feb 11 22:14:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: babu moger X-Patchwork-Id: 550951 Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1BMGNNf015518 for ; Fri, 11 Feb 2011 22:16:44 GMT 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 p1BMDUg7000819; Fri, 11 Feb 2011 17:13:31 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p1BMDS0s017889 for ; Fri, 11 Feb 2011 17:13:28 -0500 Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.17]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p1BMDNVE014661 for ; Fri, 11 Feb 2011 17:13:23 -0500 Received: from na3sys009aog115.obsmtp.com (na3sys009aog115.obsmtp.com [74.125.149.238]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p1BMDDev021229 for ; Fri, 11 Feb 2011 17:13:14 -0500 Received: from source ([192.19.220.66]) (using TLSv1) by na3sys009aob115.postini.com ([74.125.148.12]) with SMTP ID DSNKTVW0eY1tne/KyrBKfD8NcVTivi61y/wa@postini.com; Fri, 11 Feb 2011 14:13:14 PST Received: from coshub01.lsi.com (135.142.2.64) by COSEDGE01.lsi.com (192.19.220.66) with Microsoft SMTP Server (TLS) id 8.3.137.0; Fri, 11 Feb 2011 15:13:40 -0700 Received: from cosmail01.lsi.com ([172.21.36.24]) by coshub01.lsi.com ([135.142.2.64]) with mapi; Fri, 11 Feb 2011 15:14:07 -0700 From: "Moger, Babu" To: "linux-scsi@vger.kernel.org" , "dm-devel@redhat.com" Date: Fri, 11 Feb 2011 15:14:08 -0700 Thread-Topic: [PATCH} scsi_dh_rdac: fix for lun_table update for rdac device handler Thread-Index: AcvKOQCuy8WUVtl2Sgq8r/t1AXOQJg== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-RedHat-Spam-Score: 0 () X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.17 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id p1BMDS0s017889 X-loop: dm-devel@redhat.com Cc: "Krishnasamy, Somasundaram" Subject: [dm-devel] [PATCH} scsi_dh_rdac: fix for lun_table update for rdac device handler 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 11 Feb 2011 22:16:44 +0000 (UTC) --- linux-2.6.38-rc4/drivers/scsi/device_handler/scsi_dh_rdac.c.orig 2011-02-11 12:41:27.000000000 -0600 +++ linux-2.6.38-rc4/drivers/scsi/device_handler/scsi_dh_rdac.c 2011-02-11 14:04:23.000000000 -0600 @@ -281,11 +281,13 @@ static struct request *get_rdac_req(stru } static struct request *rdac_failover_get(struct scsi_device *sdev, - struct rdac_dh_data *h) + struct rdac_dh_data *h, struct list_head *list) { struct request *rq; struct rdac_mode_common *common; unsigned data_size; + struct rdac_queue_data *qdata; + u8 *lun_table; if (h->ctlr->use_ms10) { struct rdac_pg_expanded *rdac_pg; @@ -298,6 +300,7 @@ static struct request *rdac_failover_get rdac_pg->subpage_code = 0x1; rdac_pg->page_len[0] = 0x01; rdac_pg->page_len[1] = 0x28; + lun_table = rdac_pg->lun_table; } else { struct rdac_pg_legacy *rdac_pg; @@ -307,11 +310,16 @@ static struct request *rdac_failover_get common = &rdac_pg->common; rdac_pg->page_code = RDAC_PAGE_CODE_REDUNDANT_CONTROLLER; rdac_pg->page_len = 0x68; + lun_table = rdac_pg->lun_table; } common->rdac_mode[1] = RDAC_MODE_TRANSFER_SPECIFIED_LUNS; common->quiescence_timeout = RDAC_QUIESCENCE_TIME; common->rdac_options = RDAC_FORCED_QUIESENCE; + list_for_each_entry(qdata, list, entry) { + lun_table[qdata->h->lun] = 0x81; + } + /* get request for block layer packet command */ rq = get_rdac_req(sdev, &h->ctlr->mode_select, data_size, WRITE); if (!rq) @@ -565,7 +573,6 @@ static void send_mode_select(struct work int err, retry_cnt = RDAC_RETRY_COUNT; struct rdac_queue_data *tmp, *qdata; LIST_HEAD(list); - u8 *lun_table; spin_lock(&ctlr->ms_lock); list_splice_init(&ctlr->ms_head, &list); @@ -573,21 +580,12 @@ static void send_mode_select(struct work ctlr->ms_sdev = NULL; spin_unlock(&ctlr->ms_lock); - if (ctlr->use_ms10) - lun_table = ctlr->mode_select.expanded.lun_table; - else - lun_table = ctlr->mode_select.legacy.lun_table; - retry: err = SCSI_DH_RES_TEMP_UNAVAIL; - rq = rdac_failover_get(sdev, h); + rq = rdac_failover_get(sdev, h, &list); if (!rq) goto done; - list_for_each_entry(qdata, &list, entry) { - lun_table[qdata->h->lun] = 0x81; - } - RDAC_LOG(RDAC_LOG_FAILOVER, sdev, "array %s, ctlr %d, " "%s MODE_SELECT command", (char *) h->ctlr->array_name, h->ctlr->index,