linux/drivers/block/null_blk
Damien Le Moal aacae8c469 block: null_blk: Fix null_zone_write()
The bio and rq fields of struct nullb_cmd are now overlapping in a
union. So we cannot use a test on ->bio being non-NULL to detect the
NULL_Q_BIO queue mode. null_zone_write() use such broken test to set the
sector position of a zone append write in the command bio or request.
When the null_blk device uses the NULL_Q_MQ queue mode,
null_zone_write() wrongly end up setting the bio sector position,
resulting in the command request to be broken and random crashes
following.

Fix this by testing the device queue mode directly.

Fixes: 8ba816b23a ("null-blk: save memory footprint for struct nullb_cmd")
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20220602120344.1365329-1-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-06-02 07:11:28 -06:00
..
Kconfig
main.c block: null_blk: Fix null_zone_write() 2022-06-02 07:11:28 -06:00
Makefile
null_blk.h block: null_blk: Fix null_zone_write() 2022-06-02 07:11:28 -06:00
trace.c
trace.h block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
zoned.c block: null_blk: Fix null_zone_write() 2022-06-02 07:11:28 -06:00