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@xxxxxxx> >>> Signed-off-by: Kay Sievers <kay.sievers@xxxxxxxx> >>> --- <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); -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html