Ming Lei 5291984004 dm: fix bio polling to handle possibile BLK_STS_AGAIN
Expanded testing of DM's bio polling support (using more fio threads
to dm-linear ontop of null_blk) exposed the possibility for polled
bios to hang (repeatedly polling in io_uring) when null_blk responds
with BLK_STS_AGAIN (due to lack of resources):

1) io_complete_rw_iopoll() is called from blkdev_bio_end_io_async() to
   notify kiocb is done, that is the completion interface between block
   layer and io_uring

2) io_complete_rw_iopoll() is called from io_do_iopoll()

3) dm returns BLK_STS_AGAIN for one bio (on behalf of underlying
   driver), then io_complete_rw_iopoll is called, but io_do_iopoll()
   doesn't handle -EAGAIN at all (due to logic in io_rw_should_reissue)

4) reason for dm's BLK_STS_AGAIN is underlying null_blk driver ran out
   of requests (easier to reproduce by setting low hw_queue_depth).

5) dm should handle BLK_STS_AGAIN for POLLED underlying IO, and may
   retry in dm layer.

This fix adds REQ_POLLED specific BLK_STS_AGAIN handling to
dm_io_complete() that clears REQ_POLLED and requeues the bio to DM
using queue_io().

Fixes: b99fdcdc3636 ("dm: support bio polling")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
[snitzer: revised header, reused dm_io_complete's REQ_POLLED case]
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
2022-04-01 13:23:12 -04:00
..
2022-03-02 12:15:54 -05:00
2022-03-24 19:37:53 -07:00
2022-03-24 19:37:53 -07:00
2022-03-24 19:37:53 -07:00
2022-03-24 19:37:53 -07:00
2022-03-24 19:37:53 -07:00
2022-02-22 21:11:08 -05:00
2021-12-04 08:58:51 -08:00
2022-01-06 08:37:03 -08:00
2022-03-24 19:37:53 -07:00
2022-03-21 17:16:01 -07:00
2022-02-22 21:11:08 -05:00
2022-02-22 21:11:08 -05:00
2022-03-08 15:16:54 -08:00
2022-03-26 11:51:46 -07:00
2022-03-08 15:16:54 -08:00
2019-03-12 10:15:18 -07:00
2022-03-26 11:51:46 -07:00
2022-03-26 11:51:46 -07:00
2022-01-06 08:37:02 -08:00
2022-03-24 19:37:53 -07:00
2022-03-08 15:16:54 -08:00