diff mbox series

[1/1] block: don't inject fake timeouts on quiesced queues

Message ID 1588974295-15294-1-git-send-email-alan.adamson@oracle.com (mailing list archive)
State New, archived
Headers show
Series [1/1] block: don't inject fake timeouts on quiesced queues | expand

Commit Message

Alan Adamson May 8, 2020, 9:44 p.m. UTC
Injecting a fake block timeout error when the queue is QUIESCED, a hang can
occur.  The fix is to ingnore the request to fake a timeout id the queue is
QUIESCED.

Signed-off-by: Alan Adamson <alan.adamson@oracle.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
---
 block/blk-timeout.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index 8aa68fae96ad..482a777295ba 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -22,10 +22,10 @@  static int __init setup_fail_io_timeout(char *str)
 
 int blk_should_fake_timeout(struct request_queue *q)
 {
-	if (!test_bit(QUEUE_FLAG_FAIL_IO, &q->queue_flags))
-		return 0;
-
-	return should_fail(&fail_io_timeout, 1);
+	if (test_bit(QUEUE_FLAG_FAIL_IO, &q->queue_flags) &&
+	    !blk_queue_quiesced(q))
+		return should_fail(&fail_io_timeout, 1);
+	return 0;
 }
 
 static int __init fail_io_timeout_debugfs(void)