From patchwork Mon Jan 31 20:38:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: babu moger X-Patchwork-Id: 521001 Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0VKgipN006907 for ; Mon, 31 Jan 2011 20:43:06 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0VKdGij005127; Mon, 31 Jan 2011 15:39:17 -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 p0VKcM4J001816 for ; Mon, 31 Jan 2011 15:38:22 -0500 Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.8]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0VKcH5V012324 for ; Mon, 31 Jan 2011 15:38:17 -0500 Received: from na3sys009aog101.obsmtp.com (na3sys009aog101.obsmtp.com [74.125.149.67]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0VKc5o2011983 for ; Mon, 31 Jan 2011 15:38:05 -0500 Received: from source ([192.19.220.66]) (using TLSv1) by na3sys009aob101.postini.com ([74.125.148.12]) with SMTP ID DSNKTUcdrb+sFl/cWhje1JIZhj3eMs0JlMBJ@postini.com; Mon, 31 Jan 2011 12:38:05 PST Received: from coscas01.lsi.com (172.21.36.60) by COSEDGE01.lsi.com (192.19.220.66) with Microsoft SMTP Server (TLS) id 8.3.137.0; Mon, 31 Jan 2011 13:38:47 -0700 Received: from cosmail01.lsi.com ([172.21.36.24]) by coscas01.lsi.com ([172.21.36.60]) with mapi; Mon, 31 Jan 2011 13:38:52 -0700 From: "Moger, Babu" To: device-mapper development Date: Mon, 31 Jan 2011 13:38:50 -0700 Thread-Topic: [dm-devel] [PATCH]: scsi_dh_rdac: fix BUG_ON in get_rdac_data from within send_mode_select Thread-Index: AcvAXyff7DDeJ/7OQaygg6TWq8i3xQBJZK5Q Message-ID: References: In-Reply-To: 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: -2.301 (RCVD_IN_DNSWL_MED,SPF_PASS) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.8 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id p0VKcM4J001816 X-loop: dm-devel@redhat.com Cc: "Menny_Hamburger@dell.com" Subject: Re: [dm-devel] [PATCH]: scsi_dh_rdac: fix BUG_ON in get_rdac_data from within send_mode_select 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]); Mon, 31 Jan 2011 20:43:06 +0000 (UTC) diff -r -U 2 a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c --- a/drivers/scsi/device_handler/scsi_dh_rdac.c 2011-01-30 11:02:31.271426000 +0200 +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c 2011-01-30 11:02:31.327069000 +0200 @@ -853,8 +853,22 @@ spin_lock_irqsave(sdev->request_queue->queue_lock, flags); scsi_dh_data = retrieve_scsi_dh_data(sdev); - store_scsi_dh_data(sdev, NULL); spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); h = (struct rdac_dh_data *) scsi_dh_data->buf; + if (h->ctlr) { + int flush; + + spin_lock(&h->ctlr->ms_lock); + flush = (h->ctlr->ms_sdev == sdev); + spin_unlock(&h->ctlr->ms_lock); + + if (flush) + flush_workqueue(kmpath_rdacd); + } + + spin_lock_irqsave(sdev->request_queue->queue_lock, flags); + store_scsi_dh_data(sdev, NULL); + spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); + if (h->ctlr) kref_put(&h->ctlr->kref, release_controller);