]> git.baikalelectronics.ru Git - kernel.git/commit
cfq-iosched: fix RCU race in the cfq io_context destructor handling
authorJens Axboe <jens.axboe@oracle.com>
Wed, 7 May 2008 07:17:12 +0000 (09:17 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 7 May 2008 07:28:57 +0000 (09:28 +0200)
commit660843a409fa77fef5c5ba90b76d505e0c6abde6
tree6b88b2b043cac10b34234320c68e06848c00127c
parent98f02bc00f321f36b9a98d99a144036ffc6c4d63
cfq-iosched: fix RCU race in the cfq io_context destructor handling

put_io_context() drops the RCU read lock before calling into cfq_dtor(),
however we need to hold off freeing there before grabbing and
dereferencing the first object on the list.

So extend the rcu_read_lock() scope to cover the calling of cfq_dtor(),
and optimize cfq_free_io_context() to use a new variant for
call_for_each_cic() that assumes the RCU read lock is already held.

Hit in the wild by Alexey Dobriyan <adobriyan@gmail.com>

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/blk-ioc.c
block/cfq-iosched.c