]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: use return value from blk_execute_rq()
authorKeith Busch <kbusch@kernel.org>
Thu, 10 Jun 2021 21:44:37 +0000 (14:44 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 30 Jun 2021 21:35:45 +0000 (15:35 -0600)
commitae5e6886b4f8d62a9d01fea4221a854e541a1cd0
tree41ba3ca8dd0c5c15944255b6c6c783580c811c2e
parentfb9b16e15cd70e21d8af7f03d700deb9509c2ce8
nvme: use return value from blk_execute_rq()

We don't have an nvme status to report if the driver's .queue_rq()
returns an error without dispatching the requested nvme command. Check
the return value from blk_execute_rq() for all passthrough commands so
the caller may know their command was not successful.

If the command is from the target passthrough interface and fails to
dispatch, synthesize the response back to the host as a internal target
error.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Link: https://lore.kernel.org/r/20210610214437.641245-5-kbusch@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/core.c
drivers/nvme/host/ioctl.c
drivers/nvme/host/nvme.h
drivers/nvme/target/passthru.c