Skip to content

Commit

Permalink
s390/scm_blk: fix endless loop for requests != REQ_TYPE_FS
Browse files Browse the repository at this point in the history
The while loop only peeks at the top request in the queue but does
not yet consume it. Since we only handle fs requests, we need to
dequeue and complete all other request command types with error
just in case we would ever receive such an unforeseen request.

Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Steffen Maier authored and Martin Schwidefsky committed Nov 6, 2013
1 parent 1060786 commit de9587a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/s390/block/scm_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,12 @@ static void scm_blk_request(struct request_queue *rq)
int ret;

while ((req = blk_peek_request(rq))) {
if (req->cmd_type != REQ_TYPE_FS)
if (req->cmd_type != REQ_TYPE_FS) {
blk_start_request(req);
blk_dump_rq_flags(req, KMSG_COMPONENT " bad request");
blk_end_request_all(req, -EIO);
continue;
}

if (!scm_permit_request(bdev, req)) {
scm_ensure_queue_restart(bdev);
Expand Down

0 comments on commit de9587a

Please sign in to comment.