diff options
author | Josef Bacik <jbacik@fb.com> | 2017-10-02 16:22:08 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-10-02 16:29:09 -0400 |
commit | 6e60a3bbb45bd8b307269d6a821ee2c72d815846 (patch) | |
tree | 9bfd658c8774613bd601ea9b5251d2e0eec99d11 | |
parent | a5f3d8a5eaaf917878f07998e6f1ea46024e6bab (diff) |
nbd: fix -ERESTARTSYS handling
Christoph made it so that if we return'ed BLK_STS_RESOURCE whenever we
got ERESTARTSYS from sending our packets we'd return BLK_STS_OK, which
means we'd never requeue and just hang. We really need to return the
right value from the upper layer.
Fixes: fc17b6534eb8 ("blk-mq: switch ->queue_rq return value to blk_status_t")
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/block/nbd.c | 6 |
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, | |||
820 | * appropriate. | 820 | * appropriate. |
821 | */ | 821 | */ |
822 | ret = nbd_handle_cmd(cmd, hctx->queue_num); | 822 | ret = nbd_handle_cmd(cmd, hctx->queue_num); |
823 | if (ret < 0) | ||
824 | ret = BLK_STS_IOERR; | ||
825 | else if (!ret) | ||
826 | ret = BLK_STS_OK; | ||
823 | complete(&cmd->send_complete); | 827 | complete(&cmd->send_complete); |
824 | 828 | ||
825 | return ret < 0 ? BLK_STS_IOERR : BLK_STS_OK; | 829 | return ret; |
826 | } | 830 | } |
827 | 831 | ||
828 | static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg, | 832 | static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg, |