]> git.baikalelectronics.ru Git - kernel.git/commit
block: Fix list corruption of blk stats callback list
authorJan Kara <jack@suse.cz>
Tue, 11 Apr 2017 09:29:01 +0000 (11:29 +0200)
committerJens Axboe <axboe@fb.com>
Tue, 11 Apr 2017 14:09:14 +0000 (08:09 -0600)
commitf0c73f5b8f83319b358ada1faf031e8f195df0e3
tree1070c884072bcc98912373ca6953c2010451b1a5
parenteabb0f75f19ca478eef62f64c6a467f083019214
block: Fix list corruption of blk stats callback list

When CFQ calls wbt_disable_default(), it will call
blk_stat_remove_callback() to stop gathering IO statistics for the
purposes of writeback throttling. Later, when request_queue is
unregistered, wbt_exit() will call blk_stat_remove_callback() again
which will try to delete callback from the list again and possibly cause
list corruption.

Fix the problem by making wbt_disable_default() called wbt_exit() which
is properly guarded against being called multiple times.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-wbt.c