]> git.baikalelectronics.ru Git - kernel.git/commit
block: fix stacked driver stats init and free
authorJens Axboe <axboe@fb.com>
Tue, 21 Mar 2017 23:20:01 +0000 (17:20 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 21 Mar 2017 23:20:01 +0000 (17:20 -0600)
commit26e3881729dd3e9f055907c01f8747de8de56edd
treebaf705377f5e7a1d330eb0ece93f68e1aafe2161
parentea0d278a27101e756c2d56a0d92b4a4ee2a2fe1e
block: fix stacked driver stats init and free

If a driver allocates a queue for stacked usage, then it does
not currently get stats allocated. This causes the later init
of, eg, writeback throttling to blow up. Move the init to the
queue allocation instead.

Additionally, allow a NULL callback unregistration. This avoids
having the caller check for that, fixing another oops on
removal of a block device that doesn't have poll stats allocated.

Fixes: ea0d278a2710 ("blk-stat: convert to callback-based statistics reporting")
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-core.c
block/blk-stat.c