From patchwork Wed Jul 28 23:00:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: babu moger X-Patchwork-Id: 114930 Received: from mx01.colomx.prod.int.phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6SN2b8u001114 for ; Wed, 28 Jul 2010 23:03:21 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx01.colomx.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6SN0XG1023741; Wed, 28 Jul 2010 19:00:33 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6SN0Wbp025542 for ; Wed, 28 Jul 2010 19:00:32 -0400 Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.8]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6SN0Rtn011273 for ; Wed, 28 Jul 2010 19:00:27 -0400 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 o6SN0Esr022944 for ; Wed, 28 Jul 2010 19:00:15 -0400 Received: from source ([147.145.40.20]) by na3sys009aob113.postini.com ([74.125.148.12]) with SMTP ID DSNKTFC2fiefWabdzv5qESa3/KdFNJClJ2UU@postini.com; Wed, 28 Jul 2010 16:00:15 PDT Received: from milmhbs0.lsil.com (mhbs.lsil.com [147.145.1.30]) by mail0.lsil.com (8.12.11/8.12.11) with ESMTP id o6SN0DCd000331; Wed, 28 Jul 2010 16:00:13 -0700 (PDT) Received: from coscas01.lsi.com (coscas01.co.lsil.com [172.21.36.60]) by milmhbs0.lsil.com (8.12.11/8.12.11) with ESMTP id o6SN0EB4025938; Wed, 28 Jul 2010 16:00:14 -0700 Received: from cosmail01.lsi.com ([172.21.36.24]) by coscas01.lsi.com ([172.21.36.60]) with mapi; Wed, 28 Jul 2010 17:00:13 -0600 From: "Moger, Babu" To: device-mapper development , "linux-scsi@vger.kernel.org" Date: Wed, 28 Jul 2010 17:00:11 -0600 Thread-Topic: [PATCH 6/6] scsi_dh : release the refcounts in scsi_dh_rdac handler when activate is complete Thread-Index: AcsuqKHZ4knuwjzLQgm3mUgI49ghhw== 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-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.8 X-Scanned-By: MIMEDefang 2.39 X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED,SPF_PASS) X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id o6SN0Wbp025542 X-loop: dm-devel@redhat.com Cc: "Stankey, Robert" Subject: [dm-devel] [PATCH 6/6] scsi_dh : release the refcounts in scsi_dh_rdac handler when activate is complete 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 (demeter.kernel.org [140.211.167.41]); Wed, 28 Jul 2010 23:03:22 +0000 (UTC) --- linux-2.6.35-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c.orig 2010-07-23 05:51:24.000000000 -0500 +++ linux-2.6.35-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c 2010-07-23 05:54:05.000000000 -0500 @@ -209,6 +209,7 @@ static const char *lun_state[] = struct rdac_queue_data { struct list_head entry; struct rdac_dh_data *h; + struct scsi_device *sdev; activate_complete callback_fn; void *callback_data; }; @@ -614,6 +615,9 @@ done: qdata->h->state = RDAC_STATE_ACTIVE; if (qdata->callback_fn) qdata->callback_fn(qdata->callback_data, err); + kref_put(&qdata->sdev->scsi_dh_data->kref, + scsi_dh_handler_cleanup); + put_device(&qdata->sdev->sdev_gendev); kfree(qdata); } return; @@ -630,6 +634,7 @@ static int queue_mode_select(struct scsi return SCSI_DH_RETRY; qdata->h = get_rdac_data(sdev); + qdata->sdev = sdev; qdata->callback_fn = fn; qdata->callback_data = data; @@ -663,6 +668,8 @@ static int rdac_activate(struct scsi_dev done: if (fn) fn(data, err); + kref_put(&sdev->scsi_dh_data->kref, scsi_dh_handler_cleanup); + put_device(&sdev->sdev_gendev); return 0; }