summaryrefslogtreecommitdiffstats
path: root/drivers/block/nbd.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-10-10 05:11:09 +0200
committerDavid S. Miller <davem@davemloft.net>2017-10-10 05:11:09 +0200
commitd93fa2ba64384a0bbee4ae7409d85fccb2cfcf14 (patch)
tree8e55d9d74f46ce13e4299d23c23c72b9306798c1 /drivers/block/nbd.c
parentipv6: use rcu_dereference_bh() in ipv6_route_seq_next() (diff)
parentMerge branch 'ppc-bundle' (bundle from Michael Ellerman) (diff)
downloadlinux-d93fa2ba64384a0bbee4ae7409d85fccb2cfcf14.tar.xz
linux-d93fa2ba64384a0bbee4ae7409d85fccb2cfcf14.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/block/nbd.c')
-rw-r--r--drivers/block/nbd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 3684e21d543f..883dfebd3014 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -820,9 +820,13 @@ static blk_status_t nbd_queue_rq(struct blk_mq_hw_ctx *hctx,
* appropriate.
*/
ret = nbd_handle_cmd(cmd, hctx->queue_num);
+ if (ret < 0)
+ ret = BLK_STS_IOERR;
+ else if (!ret)
+ ret = BLK_STS_OK;
complete(&cmd->send_complete);
- return ret < 0 ? BLK_STS_IOERR : BLK_STS_OK;
+ return ret;
}
static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg,