Skip to content

Commit

Permalink
scsi: need to reset unprep_rq_fn in sd_remove
Browse files Browse the repository at this point in the history
This is for block's for-2.6.36.

We need to reset q->unprep_rq_fn in sd_remove. Otherwise we hit kernel
oops if we access to a scsi disk device via sg after removing scsi
disk module.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
  • Loading branch information
FUJITA Tomonori authored and Jens Axboe committed Aug 7, 2010
1 parent 00fff26 commit 82b6d57
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2384,6 +2384,7 @@ static int sd_remove(struct device *dev)
async_synchronize_full();
sdkp = dev_get_drvdata(dev);
blk_queue_prep_rq(sdkp->device->request_queue, scsi_prep_fn);
blk_queue_unprep_rq(sdkp->device->request_queue, NULL);
device_del(&sdkp->dev);
del_gendisk(sdkp->disk);
sd_shutdown(dev);
Expand Down

0 comments on commit 82b6d57

Please sign in to comment.