From: James Bottomley <James.Bottomley@suse.de>
To: "Moger, Babu" <Babu.Moger@lsi.com>
Cc: device-mapper development <dm-devel@redhat.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"Qi, Yanling" <Yanling.Qi@lsi.com>,
"Chauhan, Vijay" <Vijay.Chauhan@lsi.com>,
"Stankey, Robert" <Robert.Stankey@lsi.com>,
"Dachepalli, Sudhir" <Sudhir.Dachepalli@lsi.com>
Subject: Re: [PATCH 3/6] scsi_dh : release the refcounts in scsi_dh_alua handler when activate is complete
Date: Thu, 29 Jul 2010 19:12:07 -0500 [thread overview]
Message-ID: <1280448727.4441.942.camel@mulgrave.site> (raw)
In-Reply-To: <E463DF2B2E584B4A82673F53D62C2EF4D05DC423@cosmail01.lsi.com>
On Wed, 2010-07-28 at 16:59 -0600, Moger, Babu wrote:
> This patch releases the refcounts when activate is complete in alua handler.
>
> Signed-off-by: Babu Moger <babu.moger@lsi.com>
> ---
> --- linux-2.6.35-rc5/drivers/scsi/device_handler/scsi_dh_alua.c.orig 2010-07-23 05:58:39.000000000 -0500
> +++ linux-2.6.35-rc5/drivers/scsi/device_handler/scsi_dh_alua.c 2010-07-23 06:00:54.000000000 -0500
> @@ -287,6 +287,8 @@ done:
> h->callback_fn(h->callback_data, err);
> h->callback_fn = h->callback_data = NULL;
> }
> + kref_put(&h->sdev->scsi_dh_data->kref, scsi_dh_handler_cleanup);
> + put_device(&h->sdev->sdev_gendev);
> return;
> }
>
> @@ -684,6 +686,8 @@ static int alua_activate(struct scsi_dev
> out:
> if (fn)
> fn(data, err);
> + kref_put(&sdev->scsi_dh_data->kref, scsi_dh_handler_cleanup);
> + put_device(&sdev->sdev_gendev);
This sequence is asking for trouble: having to remember to release two
separate references at once.
Logically what should happen is that the reference seems to be on
scsi_dh_data->sdev, so it should be taken when that's initialised and
put in scsi_dh_handler_cleanup ... so no-one has to worry about
forgetting it.
James
prev parent reply other threads:[~2010-07-30 0:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-28 22:59 [PATCH 3/6] scsi_dh : release the refcounts in scsi_dh_alua handler when activate is complete Moger, Babu
2010-07-30 0:12 ` James Bottomley [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1280448727.4441.942.camel@mulgrave.site \
--to=james.bottomley@suse.de \
--cc=Babu.Moger@lsi.com \
--cc=Robert.Stankey@lsi.com \
--cc=Sudhir.Dachepalli@lsi.com \
--cc=Vijay.Chauhan@lsi.com \
--cc=Yanling.Qi@lsi.com \
--cc=dm-devel@redhat.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).