From patchwork Tue Dec 14 16:42:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: babu moger X-Patchwork-Id: 410651 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 oBEGiQoS006954 for ; Tue, 14 Dec 2010 16:44:47 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 oBEGgBD5008107; Tue, 14 Dec 2010 11:42:11 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oBEGg9Np004909 for ; Tue, 14 Dec 2010 11:42:09 -0500 Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.13]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oBEGg4m6003505 for ; Tue, 14 Dec 2010 11:42:04 -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 oBEGfrMr010993 for ; Tue, 14 Dec 2010 11:41:53 -0500 Received: from source ([192.19.220.66]) (using TLSv1) by na3sys009aob101.postini.com ([74.125.148.12]) with SMTP ID DSNKTQeeUcLNcL2bjpULkwQIpiRGnrfYFzRq@postini.com; Tue, 14 Dec 2010 08:41:53 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.106.1; Tue, 14 Dec 2010 09:42:32 -0700 Received: from cosmail01.lsi.com ([172.21.36.24]) by coshub01.lsi.com ([135.142.2.64]) with mapi; Tue, 14 Dec 2010 09:42:17 -0700 From: "Moger, Babu" To: device-mapper development Date: Tue, 14 Dec 2010 09:42:16 -0700 Thread-Topic: [dm-devel] [PATCH 1/1]: missing call to pg_init_done causes I/O to be hung forever Thread-Index: Acua21esMYHp8ZM0SaSo6ZKOFBrOpgAElX/gABwRjDAAAPUWUAASz3VQ 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.68 on 10.5.11.25 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]); Tue, 14 Dec 2010 16:44:48 +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) {