mtd: blktrans: do blk_cleanup_queue when it is really safe to do so

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Mar 8 21:59:02 EST 2010


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=e4d64cab99a2d659bf9d6fe9ab67666bceb68d87
Commit:     e4d64cab99a2d659bf9d6fe9ab67666bceb68d87
Parent:     7de6f798e13093536b6cb229213db2fab6e6555f
Author:     Maxim Levitsky <maximlevitsky at gmail.com>
AuthorDate: Sat Feb 27 02:31:51 2010 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Mar 8 18:57:42 2010 -0800

    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 at gmail.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 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 e32c49c..03e19c1 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -32,6 +32,7 @@ void blktrans_dev_release(struct kref *kref)
 		container_of(kref, struct mtd_blktrans_dev, ref);
 
 	dev->disk->private_data = NULL;
+	blk_cleanup_queue(dev->rq);
 	put_disk(dev->disk);
 	list_del(&dev->list);
 	kfree(dev);
@@ -423,7 +424,6 @@ int del_mtd_blktrans_dev(struct mtd_blktrans_dev *old)
 	old->rq->queuedata = NULL;
 	blk_start_queue(old->rq);
 	spin_unlock_irqrestore(&old->queue_lock, flags);
-	blk_cleanup_queue(old->rq);
 
 	/* Ask trans driver for release to the mtd device */
 	mutex_lock(&old->lock);



More information about the linux-mtd-cvs mailing list