This is a note to let you know that I've just added the patch titled dm: do not return early from dm_io_complete if BLK_STS_AGAIN without polling to the 5.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: dm-do-not-return-early-from-dm_io_complete-if-blk_sts_again-without-polling.patch and it can be found in the queue-5.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 78ccef91234ba331c04d71f3ecb1377451d21056 Mon Sep 17 00:00:00 2001 From: Mike Snitzer <snitzer@xxxxxxxxxx> Date: Tue, 21 Jun 2022 13:37:06 -0400 Subject: dm: do not return early from dm_io_complete if BLK_STS_AGAIN without polling From: Mike Snitzer <snitzer@xxxxxxxxxx> commit 78ccef91234ba331c04d71f3ecb1377451d21056 upstream. Commit 5291984004edf ("dm: fix bio polling to handle possibile BLK_STS_AGAIN") inadvertently introduced an early return from dm_io_complete() without first queueing the bio to DM if BLK_STS_AGAIN occurs and bio-polling is _not_ being used. Fix this by only returning early from dm_io_complete() if the bio has first been properly queued to DM. Otherwise, the bio will never finish via bio_endio. Fixes: 5291984004edf ("dm: fix bio polling to handle possibile BLK_STS_AGAIN") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/md/dm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -899,9 +899,11 @@ static void dm_io_complete(struct dm_io if (io_error == BLK_STS_AGAIN) { /* io_uring doesn't handle BLK_STS_AGAIN (yet) */ queue_io(md, bio); + return; } } - return; + if (io_error == BLK_STS_DM_REQUEUE) + return; } if (bio_is_flush_with_data(bio)) { Patches currently in stable-queue which might be from snitzer@xxxxxxxxxx are queue-5.18/dm-era-commit-metadata-in-postsuspend-after-worker-stops.patch queue-5.18/dm-mirror-log-clear-log-bits-up-to-bits_per_long-boundary.patch queue-5.18/dm-do-not-return-early-from-dm_io_complete-if-blk_sts_again-without-polling.patch