diff mbox

loop: return proper error from loop_queue_rq()

Message ID fad6bce50526f8554f47d83d61ae334073075a6d.1479164136.git.osandov@fb.com (mailing list archive)
State New, archived
Headers show

Commit Message

Omar Sandoval Nov. 14, 2016, 10:56 p.m. UTC
From: Omar Sandoval <osandov@fb.com>

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

f4aa4c7bbac6 ("block: loop: convert to per-device workqueue")
Signed-off-by: Omar Sandoval <osandov@fb.com>
---
 drivers/block/loop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jens Axboe Nov. 14, 2016, 10:58 p.m. UTC | #1
On 11/14/2016 03:56 PM, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
>
> ->queue_rq() should return one of the BLK_MQ_RQ_QUEUE_* constants, not
> an errno.

Thanks Omar, applied.
diff mbox

Patch

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index fa1b7a9..4af8187 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1646,7 +1646,7 @@  static int loop_queue_rq(struct blk_mq_hw_ctx *hctx,
 	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: