From patchwork Mon Dec 13 18:02:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: babu moger X-Patchwork-Id: 407332 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 oBDI5iu2005483 for ; Mon, 13 Dec 2010 18:06:05 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 oBDI2rvN017414; Mon, 13 Dec 2010 13:02:54 -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 oBDI2qq6024515 for ; Mon, 13 Dec 2010 13:02:52 -0500 Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.13]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oBDI2kFe027781 for ; Mon, 13 Dec 2010 13:02:47 -0500 Received: from na3sys009aog113.obsmtp.com (na3sys009aog113.obsmtp.com [74.125.149.209]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oBDI2Zug022870 for ; Mon, 13 Dec 2010 13:02:35 -0500 Received: from source ([192.19.220.66]) (using TLSv1) by na3sys009aob113.postini.com ([74.125.148.12]) with SMTP ID DSNKTQZfu+R7DKQQRwdHTdFCFYimXDjOweMN@postini.com; Mon, 13 Dec 2010 10:02:35 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.106.1; Mon, 13 Dec 2010 11:03:13 -0700 Received: from cosmail01.lsi.com ([172.21.36.24]) by coscas01.lsi.com ([172.21.36.60]) with mapi; Mon, 13 Dec 2010 11:02:56 -0700 From: "Moger, Babu" To: device-mapper development Date: Mon, 13 Dec 2010 11:02:44 -0700 Thread-Topic: [dm-devel] [PATCH 1/1]: missing call to pg_init_done causes I/O to be hung forever Thread-Index: Acua21esMYHp8ZM0SaSo6ZKOFBrOpgAElX/g 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.3 (HTML_MESSAGE,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.13 X-loop: dm-devel@redhat.com Subject: Re: [dm-devel] [PATCH 1/1]: missing call to pg_init_done causes I/O to be hung forever 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.3 (demeter1.kernel.org [140.211.167.41]); Mon, 13 Dec 2010 18:06:05 +0000 (UTC) diff -r -U 2 a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c --- a/drivers/md/dm-mpath.c 2010-12-13 09:16:31.358858000 +0200 +++ b/drivers/md/dm-mpath.c 2010-12-13 09:16:31.796998000 +0200 @@ -1190,4 +1190,5 @@ case SCSI_DH_OK: break; + case SCSI_DH_DEV_OFFLINED: If you are not doing anything special then I would let default take care of it. No need of this change.. case SCSI_DH_NOSYS: if (!m->hw_handler_name) { @@ -1252,7 +1253,15 @@ { struct pgpath *pgpath = (struct pgpath *) data; + int err; - scsi_dh_activate(bdev_get_queue(pgpath->path.dev->bdev), + err = scsi_dh_activate(bdev_get_queue(pgpath->path.dev->bdev), pg_init_done, &pgpath->path); + + /* + * If error is not SCSI_DH_OK, we have not entered the scsi_dh H/W handler and did not call pg_init_done - + * need to call pg_init_done directly. + */ + if (err) + pg_init_done(&pgpath->path, err); } You can move this to scsi_dh.c diff -r -U 2 a/drivers/scsi/device_handler/scsi_dh.c b/drivers/scsi/device_handler/scsi_dh.c --- a/drivers/scsi/device_handler/scsi_dh.c 2010-12-13 09:16:31.616554000 +0200 +++ b/drivers/scsi/device_handler/scsi_dh.c 2010-12-13 09:16:31.878170000 +0200 @@ -443,4 +443,9 @@ spin_unlock_irqrestore(q->queue_lock, flags); + if (sdev->sdev_state == SDEV_CANCEL || + sdev->sdev_state == SDEV_DEL || + sdev->sdev_state == SDEV_OFFLINE) + err = SCSI_DH_DEV_OFFLINED; + You can change it something like below.. if (err) {