From de9587a2f54d2d0063f0dbc775328129b9daaaa2 Mon Sep 17 00:00:00 2001 From: Steffen Maier Date: Tue, 5 Nov 2013 12:59:46 +0100 Subject: [PATCH] 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 Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky --- drivers/s390/block/scm_blk.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c index 5d73e6e49af6..548209a9c43c 100644 --- a/drivers/s390/block/scm_blk.c +++ b/drivers/s390/block/scm_blk.c @@ -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); -- 2.30.2