From: Eric Biggers Date: Wed, 15 Mar 2023 18:39:06 +0000 (-0700) Subject: blk-mq: return actual keyslot error in blk_insert_cloned_request() X-Git-Tag: for-6.4/block-2023-04-21~78 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=5b8562f0e87b9bc7e581fc482e5a242885f79b88;p=linux-2.6-block.git blk-mq: return actual keyslot error in blk_insert_cloned_request() To avoid hiding information, pass on the error code from blk_crypto_rq_get_keyslot() instead of always using BLK_STS_IOERR. Signed-off-by: Eric Biggers Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230315183907.53675-2-ebiggers@kernel.org Signed-off-by: Jens Axboe --- diff --git a/block/blk-mq.c b/block/blk-mq.c index 5e819de2f5e7..a875b1cdff9b 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -3049,8 +3049,9 @@ blk_status_t blk_insert_cloned_request(struct request *rq) if (q->disk && should_fail_request(q->disk->part0, blk_rq_bytes(rq))) return BLK_STS_IOERR; - if (blk_crypto_rq_get_keyslot(rq)) - return BLK_STS_IOERR; + ret = blk_crypto_rq_get_keyslot(rq); + if (ret != BLK_STS_OK) + return ret; blk_account_io_start(rq);