Christoph Hellwig b0077e269f blk-mq: make sure active queue usage is held for bio_integrity_prep()
blk_integrity_unregister() can come if queue usage counter isn't held
for one bio with integrity prepared, so this request may be completed with
calling profile->complete_fn, then kernel panic.

Another constraint is that bio_integrity_prep() needs to be called
before bio merge.

Fix the issue by:

- call bio_integrity_prep() with one queue usage counter grabbed reliably

- call bio_integrity_prep() before bio merge

Fixes: 900e080752025f00 ("block: move queue enter logic into blk_mq_submit_bio()")
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Tested-by: Yi Zhang <yi.zhang@redhat.com>
Link: https://lore.kernel.org/r/20231113035231.2708053-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2023-11-13 08:52:52 -07:00
..
2023-11-01 12:30:07 -10:00
2023-06-30 11:57:07 -07:00
2023-08-14 15:40:42 -06:00
2023-08-29 20:21:42 -07:00
2023-04-26 12:52:58 -07:00
2023-09-22 08:52:13 -06:00
2023-06-26 12:47:20 -07:00
2023-08-14 15:40:42 -06:00
2023-06-30 11:57:07 -07:00
2023-11-01 12:30:07 -10:00
2022-03-07 12:48:35 -07:00