Skip to content

Commit

Permalink
dm: do not return early from dm_io_complete if BLK_STS_AGAIN without …
Browse files Browse the repository at this point in the history
…polling

Commit 5291984 ("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: 5291984 ("dm: fix bio polling to handle possibile BLK_STS_AGAIN")
Cc: stable@vger.kernel.org
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
  • Loading branch information
Mike Snitzer committed Jun 21, 2022
1 parent 9ae6e8b commit 78ccef9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,9 +939,11 @@ static void dm_io_complete(struct dm_io *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)) {
Expand Down

0 comments on commit 78ccef9

Please sign in to comment.