Skip to content

Commit de9587a

Browse files
steffen-maierMartin Schwidefsky
authored andcommitted
s390/scm_blk: fix endless loop for requests != REQ_TYPE_FS
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>
1 parent 1060786 commit de9587a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/s390/block/scm_blk.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,12 @@ static void scm_blk_request(struct request_queue *rq)
223223
int ret;
224224

225225
while ((req = blk_peek_request(rq))) {
226-
if (req->cmd_type != REQ_TYPE_FS)
226+
if (req->cmd_type != REQ_TYPE_FS) {
227+
blk_start_request(req);
228+
blk_dump_rq_flags(req, KMSG_COMPONENT " bad request");
229+
blk_end_request_all(req, -EIO);
227230
continue;
231+
}
228232

229233
if (!scm_permit_request(bdev, req)) {
230234
scm_ensure_queue_restart(bdev);

0 commit comments

Comments
 (0)