Skip to content

Commit

Permalink
um-ubd: Entrust re-queue to the upper layers
Browse files Browse the repository at this point in the history
Fixes crashes due to ubd requeue logic conflicting with the block-mq
logic. Crash is reproducible in 5.0 - 5.3.

Fixes: 53766de ("um: Clean-up command processing in UML UBD driver")
Cc: stable@vger.kernel.org # v5.0+
Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Anton Ivanov authored and Jens Axboe committed Oct 29, 2019
1 parent 86cccfb commit d848074
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arch/um/drivers/ubd_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -1403,8 +1403,12 @@ static blk_status_t ubd_queue_rq(struct blk_mq_hw_ctx *hctx,

spin_unlock_irq(&ubd_dev->lock);

if (ret < 0)
blk_mq_requeue_request(req, true);
if (ret < 0) {
if (ret == -ENOMEM)
res = BLK_STS_RESOURCE;
else
res = BLK_STS_DEV_RESOURCE;
}

return res;
}
Expand Down

0 comments on commit d848074

Please sign in to comment.