diff options
author | Maxim Levitsky <maximlevitsky@gmail.com> | 2010-02-26 19:31:51 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-03-08 21:57:42 -0500 |
commit | e4d64cab99a2d659bf9d6fe9ab67666bceb68d87 (patch) | |
tree | 2a43c4ccfdb2fc35d4df304d139943ca73504029 | |
parent | 7de6f798e13093536b6cb229213db2fab6e6555f (diff) |
mtd: blktrans: do blk_cleanup_queue when it is really safe to do so
I was calling it in del_mtd_blktrans_dev, but ->request_fn could
still be running at that point, thus defer this call
to blktrans_dev_release
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r-- | drivers/mtd/mtd_blkdevs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index e32c49cb4005..03e19c1965cc 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c | |||
@@ -32,6 +32,7 @@ void blktrans_dev_release(struct kref *kref) | |||
32 | container_of(kref, struct mtd_blktrans_dev, ref); | 32 | container_of(kref, struct mtd_blktrans_dev, ref); |
33 | 33 | ||
34 | dev->disk->private_data = NULL; | 34 | dev->disk->private_data = NULL; |
35 | blk_cleanup_queue(dev->rq); | ||
35 | put_disk(dev->disk); | 36 | put_disk(dev->disk); |
36 | list_del(&dev->list); | 37 | list_del(&dev->list); |
37 | kfree(dev); | 38 | kfree(dev); |
@@ -423,7 +424,6 @@ int del_mtd_blktrans_dev(struct mtd_blktrans_dev *old) | |||
423 | old->rq->queuedata = NULL; | 424 | old->rq->queuedata = NULL; |
424 | blk_start_queue(old->rq); | 425 | blk_start_queue(old->rq); |
425 | spin_unlock_irqrestore(&old->queue_lock, flags); | 426 | spin_unlock_irqrestore(&old->queue_lock, flags); |
426 | blk_cleanup_queue(old->rq); | ||
427 | 427 | ||
428 | /* Ask trans driver for release to the mtd device */ | 428 | /* Ask trans driver for release to the mtd device */ |
429 | mutex_lock(&old->lock); | 429 | mutex_lock(&old->lock); |