lkml.org 
[lkml]   [2015]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 3/7] blk-mq: Fix use after of free q->mq_map
From
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.
*/


\
 
 \ /
  Last update: 2015-10-06 02:01    [W:0.185 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site