linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Christoph Hellwig <hch@infradead.org>, Christoph Hellwig <hch@lst.de>
Cc: linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
	James Bottomley <jbottomley@parallels.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	Fam Zheng <famz@redhat.com>
Subject: Re: [PATCH 1/3] scsi: serialize ->rescan against ->remove
Date: Thu, 05 Mar 2015 14:37:43 +0100	[thread overview]
Message-ID: <54F85C27.1040108@redhat.com> (raw)
In-Reply-To: <20150305133313.GA25602@infradead.org>



On 05/03/2015 14:33, Christoph Hellwig wrote:
> Any chance to get reviews for this series?  Also we should at least
> expedite this first patch into 4.0-rc as it fixes scanning races
> in virtio_scsi.

I reviewed 1 and 3, but I'm not really qualified for patch 2.

Paolo

> On Mon, Feb 02, 2015 at 02:01:24PM +0100, Christoph Hellwig wrote:
>> Lock the device embedded in the scsi_device to protect against
>> concurrent calls to ->remove.
>>
>> Signed-off-by: Christoph Hellwig <hch@lst.de>
>> Acked-by: Alan Stern <stern@rowland.harvard.edu>
>> ---
>>  drivers/scsi/scsi_scan.c | 7 +++----
>>  1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
>> index 983aed1..523faee 100644
>> --- a/drivers/scsi/scsi_scan.c
>> +++ b/drivers/scsi/scsi_scan.c
>> @@ -1593,16 +1593,15 @@ EXPORT_SYMBOL(scsi_add_device);
>>  
>>  void scsi_rescan_device(struct device *dev)
>>  {
>> -	if (!dev->driver)
>> -		return;
>> -
>> -	if (try_module_get(dev->driver->owner)) {
>> +	device_lock(dev);
>> +	if (dev->driver && try_module_get(dev->driver->owner)) {
>>  		struct scsi_driver *drv = to_scsi_driver(dev->driver);
>>  
>>  		if (drv->rescan)
>>  			drv->rescan(dev);
>>  		module_put(dev->driver->owner);
>>  	}
>> +	device_unlock(dev);
>>  }
>>  EXPORT_SYMBOL(scsi_rescan_device);
>>  
>> -- 
>> 1.9.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> ---end quoted text---
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2015-03-05 13:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-02 13:01 [PATCH 1/3] scsi: serialize ->rescan against ->remove Christoph Hellwig
2015-02-02 13:01 ` [PATCH 2/3] sd: don't grab a device references from driver methods Christoph Hellwig
2015-03-10 16:21   ` Hannes Reinecke
2015-02-02 13:01 ` [PATCH 3/3] scsi: proper state checking and module refcount handling in scsi_device_get Christoph Hellwig
2015-03-05 13:36   ` Paolo Bonzini
2015-03-10 16:22   ` Hannes Reinecke
2015-04-29  1:17   ` Akinobu Mita
2015-04-29 13:27     ` Christoph Hellwig
2015-03-05 13:33 ` [PATCH 1/3] scsi: serialize ->rescan against ->remove Christoph Hellwig
2015-03-05 13:37   ` Paolo Bonzini [this message]
2015-03-16 17:29     ` Paolo Bonzini
2015-03-05 13:36 ` Paolo Bonzini
2015-03-10 16:20 ` Hannes Reinecke
  -- strict thread matches above, loose matches on Subject: below --
2015-01-28 23:00 Christoph Hellwig
2015-01-29 20:09 ` Alan Stern
2015-01-29 23:11 ` Paolo Bonzini
2015-01-30  1:08   ` Fam Zheng
2015-01-30  9:46     ` Paolo Bonzini
2015-02-02 12:59       ` Christoph Hellwig
2015-02-02 13:14         ` Paolo Bonzini

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=54F85C27.1040108@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=bvanassche@acm.org \
    --cc=famz@redhat.com \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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).