[PATCH 4.9 51/83] loop: return proper error from loop_queue_rq()

From: Greg Kroah-Hartman
Date: Wed Jan 04 2017 - 15:14:44 EST


4.9-stable review patch. If anyone has any objections, please let me know.

------------------

From: Omar Sandoval <osandov@xxxxxx>

commit b4a567e8114327518c09f5632339a5954ab975a3 upstream.

->queue_rq() should return one of the BLK_MQ_RQ_QUEUE_* constants, not
an errno.

Fixes: f4aa4c7bbac6 ("block: loop: convert to per-device workqueue")
Signed-off-by: Omar Sandoval <osandov@xxxxxx>
Signed-off-by: Jens Axboe <axboe@xxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
drivers/block/loop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1646,7 +1646,7 @@ static int loop_queue_rq(struct blk_mq_h
blk_mq_start_request(bd->rq);

if (lo->lo_state != Lo_bound)
- return -EIO;
+ return BLK_MQ_RQ_QUEUE_ERROR;

switch (req_op(cmd->rq)) {
case REQ_OP_FLUSH: