lkml.org 
[lkml]   [2022]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.18 030/181] dm: do not return early from dm_io_complete if BLK_STS_AGAIN without polling
    Date
    From: Mike Snitzer <snitzer@kernel.org>

    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@vger.kernel.org
    Signed-off-by: Mike Snitzer <snitzer@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    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)) {

    \
     
     \ /
      Last update: 2022-06-27 13:49    [W:2.336 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site