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: 34dbad5d ("blk-stat: convert to callback-based statistics reporting") Signed-off-by: NJens Axboe <axboe@fb.com>
Showing
想要评论请 注册 或 登录