Messages in this thread | | | Date | Tue, 6 Oct 2015 08:50:47 +0900 | Subject | Re: [PATCH v4 3/7] blk-mq: Fix use after of free q->mq_map | From | Akinobu Mita <> |
| |
2015-09-29 15:52 GMT+09:00 Christoph Hellwig <hch@lst.de>: > Looks good, > > Reviewed-by: Christoph Hellwig <hch@lst.de> > > Can you also add a patch that renames blk_mq_free_queue to > blk_mq_cleaup_queue and adds a comment that we should not free any memory > here? We had way too many bugs of this kinds unfortunately.
Renaming blk_mq_free_queue to blk_mq_cleaup_queue sounds good because it is called from blk_cleanup_queue().
How about adding comment like below?
/* * The resources allocated by blk_mq_init_allocated_queue() are released * by blk_mq_cleanup_queue() and blk_mq_release(). * * blk_mq_cleanup_queue() is called from blk_cleanup_queue(), so * the resources which may be used after blk_cleanup_queue() shouldn't * be released here. Instead, those should be released by blk_mq_release() * which is called from blk_release_queue(). * * For example, loop and md drivers call del_gendisk() after * blk_cleanup_queue(), so the resources used when accessing sysfs entries * for blk-mq shouldn't be released by blk_mq_cleanup_queue() as these sysfs * entries can be accessible before del_gendisk() is called. */
| |