All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>,
	Hannes Reinecke <hare@suse.de>
Cc: linux-scsi@vger.kernel.org, Kay Sievers <kay.sievers@vrfy.org>,
	Alan Stern <stern@rowland.harvard.edu>
Subject: Re: [PATCH] Driver 'sd' needs updating
Date: Thu, 25 Jun 2009 20:20:19 +0300	[thread overview]
Message-ID: <4A43B1D3.2030602@panasas.com> (raw)
In-Reply-To: <4A3DF254.6020108@panasas.com>

On 06/21/2009 11:41 AM, Boaz Harrosh wrote:
> On 06/19/2009 06:41 AM, James Bottomley wrote:
>> On Thu, 2009-06-18 at 09:57 +0200, Hannes Reinecke wrote:
>>> If a SCSI ULD driver sets blk_queue_prep_rq(), it should clean it
>>> up itself on remove(), and not from the bus callbacks. This
>>> removes the need to hook into bus->remove(), which should not
>>> be used at the same time as driver->remove().
>>>
>>> Signed-off-by: Hannes Reinecke <hare@suse.de>
>>> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
>>> ---
<snip>

>>> @@ -2053,6 +2053,7 @@ static int sd_remove(struct device *dev)
>>>  	struct scsi_disk *sdkp;
>>>  
>>>  	async_synchronize_full();
>>> +	blk_queue_prep_rq(sdkp->device->request_queue, scsi_prep_fn);
>>>  	sdkp = dev_get_drvdata(dev);
>> This isn't really going to work ... you're using sdkp before it gets
>> initialised ... did this actually get tested?
>>
> 
> I have tested the previous iteration heavily. But yes this looks like an
> uncareful rebase fallout. The last two lines should just be exchanged.
> 

I have now *tested* with the above blk_queue_prep_rq() call just after the
"sdkp = dev_get_drvdata(dev);" 

Thanks
Boaz
---
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 93c4bed..a6bb147 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2053,8 +2053,8 @@ static int sd_remove(struct device *dev)
 	struct scsi_disk *sdkp;
 
 	async_synchronize_full();
-	blk_queue_prep_rq(sdkp->device->request_queue, scsi_prep_fn);
 	sdkp = dev_get_drvdata(dev);
+	blk_queue_prep_rq(sdkp->device->request_queue, scsi_prep_fn);
 	device_del(&sdkp->dev);
 	del_gendisk(sdkp->disk);
 	sd_shutdown(dev);

  reply	other threads:[~2009-06-25 17:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-18  7:57 [PATCH] Driver 'sd' needs updating Hannes Reinecke
2009-06-19  3:41 ` James Bottomley
2009-06-21  8:41   ` Boaz Harrosh
2009-06-25 17:20     ` Boaz Harrosh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-03-24 14:14 Hannes Reinecke
2009-03-24 14:43 ` Boaz Harrosh
2009-03-24 15:01   ` Hannes Reinecke
2009-03-24 15:01     ` Hannes Reinecke
2009-03-24 15:33     ` Boaz Harrosh
2009-03-24 15:45 ` Boaz Harrosh
2009-03-24 15:52   ` Hannes Reinecke

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=4A43B1D3.2030602@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=hare@suse.de \
    --cc=kay.sievers@vrfy.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.