Linux SCSI subsystem development
 help / color / mirror / Atom feed
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 2/6] scsi_dh : increment the refcounts while calling activate
Date: Thu, 29 Jul 2010 19:08:40 -0500	[thread overview]
Message-ID: <1280448520.4441.930.camel@mulgrave.site> (raw)
In-Reply-To: <E463DF2B2E584B4A82673F53D62C2EF4D05DC422@cosmail01.lsi.com>

On Wed, 2010-07-28 at 16:59 -0600, Moger, Babu wrote:
> Hold the refcounts for device and scsi_dh_data while calling handler's
> activate. This will make sure that devices and scsi_dh_data are not
> removed while activate is still in progress. Make sure to call
> put_device and kref_put in the handler after activate is complete.

This is a complete no-no.  You can't take unreleased references in a
single patch.  I know the releases come in subsequent patches, but
that's not the way to do it.  You have to have an atomic change (as in
all refcounts must balance on either side of the patch).  If someone
bisected into this, it would likely never release stuff ... which could
lead to some unnecessary debugging.

James



  parent reply	other threads:[~2010-07-30  0:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-28 22:59 [PATCH 2/6] scsi_dh : increment the refcounts while calling activate Moger, Babu
2010-07-29  4:46 ` [dm-devel] " Shyam Iyer
2010-07-30  0:08 ` James Bottomley [this message]
2010-07-30 18:15   ` Moger, Babu

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=1280448520.4441.930.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