s390/scm_blk: fix endless loop for requests != REQ_TYPE_FS
authorSteffen Maier <maier@linux.vnet.ibm.com>
Tue, 5 Nov 2013 11:59:46 +0000 (12:59 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 6 Nov 2013 13:32:22 +0000 (14:32 +0100)
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>
drivers/s390/block/scm_blk.c

index 5d73e6e49af6c96cb9e97b60163485b1ba5dbb8b..548209a9c43c58ae687809d5da605f7b8e97184b 100644 (file)
@@ -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);