Skip to contentSkip to conversation

blk-mq: Fix timeout handling in case the timeout handler returns BLK_EH_DONE

PATCH In review Bart Van Assche 2 participants 2 messages Jun 22, 2018 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 blk-mq: Fix timeout handling in case the timeout handler returns BLK_EH_DONE

Make sure that RQF_TIMED_OUT is cleared when a request is reused after a block driver timeout handler has returned BLK_EH_DONE.

Fixes da6612673988 ("blk-mq: don't time out requests again that are in the timeout handler")
Cc Christoph Hellwig <[email protected]>
Cc Jianchao Wang <[email protected]>
Cc Andrew Randrianasulu <[email protected]>
---
 block/blk-mq.c      | 1 -
 block/blk-timeout.c | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
block/blk-mq.c +0 -1
index b97cb6fed3bd..8c00fcd300b9 100644
@@ -785,7 +785,6 @@ static void blk_mq_rq_timed_out(struct request *req, bool reserved)
 		WARN_ON_ONCE(ret != BLK_EH_RESET_TIMER);
 	}
 
-	req->rq_flags &= ~RQF_TIMED_OUT;
 	blk_add_timer(req);
 }
 
block/blk-timeout.c +1 -0
index c788255b18ad..d72e9071b17f 100644
@@ -213,6 +213,7 @@ void blk_add_timer(struct request *req)
 	if (!req->timeout)
 		req->timeout = q->rq_timeout;
 
+	req->rq_flags &= ~RQF_TIMED_OUT;
 	blk_rq_set_deadline(req, jiffies + req->timeout);
 
 	/*
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 2 lines · Bart Van Assche

Make sure that RQF_TIMED_OUT is cleared when a request is reused after a block driver timeout handler has returned BLK_EH_DONE.

Thanks Bart, I think this looks good. I'm going to try and take some time to go over the timeout parts, to ensure that we're good for 4.18.

Signature · 1 line
Jens Axboe