Skip to content

Commit 6e60a3b

Browse files
Josef Bacikaxboe
authored andcommitted
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: fc17b65 ("blk-mq: switch ->queue_rq return value to blk_status_t") Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent a5f3d8a commit 6e60a3b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/block/nbd.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,9 +820,13 @@ static blk_status_t nbd_queue_rq(struct blk_mq_hw_ctx *hctx,
820820
* appropriate.
821821
*/
822822
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;
823827
complete(&cmd->send_complete);
824828

825-
return ret < 0 ? BLK_STS_IOERR : BLK_STS_OK;
829+
return ret;
826830
}
827831

828832
static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg,

0 commit comments

Comments
 (0)