]> git.baikalelectronics.ru Git - kernel.git/commit
null_blk: fix zoned support for non-rq based operation
authorJens Axboe <axboe@kernel.dk>
Thu, 13 Sep 2018 00:21:11 +0000 (18:21 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 13 Sep 2018 00:21:11 +0000 (18:21 -0600)
commit8d0cd987b2e8497ca02a2a7f737f6a03ab3bd06d
tree19edd5ec97cfb6aff00875f301fecde258eba351
parentae547855e7739077fb08bf0589858cc53871570e
null_blk: fix zoned support for non-rq based operation

The supported added for zones in null_blk seem to assume that only rq
based operation is possible. But this depends on the queue_mode setting,
if this is set to 0, then cmd->bio is what we need to be operating on.
Right now any attempt to load null_blk with queue_mode=0 will
insta-crash, since cmd->rq is NULL and null_handle_cmd() assumes it to
always be set.

Make the zoned code deal with bio's instead, or pass in the
appropriate sector/nr_sectors instead.

Fixes: f5817dcb738b ("null_blk: add zone support")
Tested-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk.h
drivers/block/null_blk_main.c
drivers/block/null_blk_zoned.c