From: Israel Rukshin Date: Sun, 13 Oct 2019 16:57:32 +0000 (+0300) Subject: nvmet: use bio_io_error instead of duplicating it X-Git-Tag: for-5.5/drivers-20191121~38 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=4d764bb9a92bc63afc3befe36a0bedfddff1398a;p=linux-block.git nvmet: use bio_io_error instead of duplicating it This commit doesn't change any logic. Signed-off-by: Israel Rukshin Reviewed-by: Max Gurtovoy Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch Signed-off-by: Jens Axboe --- diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c index 32008d85172b..f2618dc2ef3a 100644 --- a/drivers/nvme/target/io-cmd-bdev.c +++ b/drivers/nvme/target/io-cmd-bdev.c @@ -261,12 +261,10 @@ static void nvmet_bdev_execute_discard(struct nvmet_req *req) if (bio) { bio->bi_private = req; bio->bi_end_io = nvmet_bio_done; - if (status) { - bio->bi_status = BLK_STS_IOERR; - bio_endio(bio); - } else { + if (status) + bio_io_error(bio); + else submit_bio(bio); - } } else { nvmet_req_complete(req, status); }