Commit 9a8d23d8 authored by Tejun Heo's avatar Tejun Heo Committed by Jens Axboe

mg_disk: fix queue hang / infinite retry on !fs requests

Both request functions in mg_disk simply return when they encounter a
!fs request, which means the request will never be cleared from the
queue causing queue hang and indefinite retry of the request.  Fix it.

While at it, flatten condition checks and add unlikely to !fs tests.

[ Impact: fix possible queue hang / infinite retry of !fs requests ]
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Cc: unsik Kim <donari75@gmail.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 8f6205cd
...@@ -672,16 +672,16 @@ static void mg_request_poll(struct request_queue *q) ...@@ -672,16 +672,16 @@ static void mg_request_poll(struct request_queue *q)
while ((req = elv_next_request(q)) != NULL) { while ((req = elv_next_request(q)) != NULL) {
host = req->rq_disk->private_data; host = req->rq_disk->private_data;
if (blk_fs_request(req)) {
switch (rq_data_dir(req)) { if (unlikely(!blk_fs_request(req))) {
case READ: __blk_end_request_cur(req, -EIO);
continue;
}
if (rq_data_dir(req) == READ)
mg_read(req); mg_read(req);
break; else
case WRITE:
mg_write(req); mg_write(req);
break;
}
}
} }
} }
...@@ -766,8 +766,10 @@ static void mg_request(struct request_queue *q) ...@@ -766,8 +766,10 @@ static void mg_request(struct request_queue *q)
continue; continue;
} }
if (!blk_fs_request(req)) if (unlikely(!blk_fs_request(req))) {
return; __blk_end_request_cur(req, -EIO);
continue;
}
if (!mg_issue_req(req, host, sect_num, sect_cnt)) if (!mg_issue_req(req, host, sect_num, sect_cnt))
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment