Skip to contentSkip to conversation

block: fix intermittent dm timeout based oops

PATCH In review Hannes Reinecke 4 participants 6 messages Mar 24, 2009 – Apr 23, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: fix intermittent dm timeout based oops

Very rarely under stress testing of dm, oopses are occuring as something tampers with an old stack frame. This has been traced back to blk_abort_queue() leaving a timeout_list pointing to the stack. The reason is that sometimes blk_abort_request() won't delete the timer (if the request is marked as complete but before the timer has been removed, a small race window). Fix this by splicing back from the ususally empty list to the q->timeout_list.

---
 block/blk-timeout.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
block/blk-timeout.c +6 -0
index bbbdc4b..6213123 100644
@@ -224,6 +224,12 @@ void blk_abort_queue(struct request_queue *q)
 	list_for_each_entry_safe(rq, tmp, &list, timeout_list)
 		blk_abort_request(rq);
 
+	/*
+	 * Occasionally, blk_abort_request() will return without
+	 * deleting the element from the list
+	 */
+	list_splice(&list, &q->timeout_list);
+
 	spin_unlock_irqrestore(q->queue_lock, flags);
 
 }
Signature · 1 line
1.5.3.2
#1 lore raw
Quoted 32 lines · Hannes Reinecke

Very rarely under stress testing of dm, oopses are occuring as something tampers with an old stack frame. This has been traced back to blk_abort_queue() leaving a timeout_list pointing to the stack. The reason is that sometimes blk_abort_request() won't delete the timer (if the request is marked as complete but before the timer has been removed, a small race window). Fix this by splicing back from the ususally empty list to the q->timeout_list.

---
 block/blk-timeout.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
block/blk-timeout.c +6 -0
index bbbdc4b..6213123 100644
@@ -224,6 +224,12 @@ void blk_abort_queue(struct request_queue *q)
 	list_for_each_entry_safe(rq, tmp, &list, timeout_list)
 		blk_abort_request(rq);
 
+	/*
+	 * Occasionally, blk_abort_request() will return without
+	 * deleting the element from the list
+	 */
+	list_splice(&list, &q->timeout_list);
+
 	spin_unlock_irqrestore(q->queue_lock, flags);
 
 }
Signature · 1 line
1.5.3.2

I just noticed that this fix is not upstream yet and i have seen test cases hitting this problem.

Jens, are you going to included this patch, or should this go through the SCSI tree?

--
Christof Schmitt

maintainer
#2 lore raw
Quoted 37 lines · Christof Schmitt
Quoted 32 lines · Hannes Reinecke

Very rarely under stress testing of dm, oopses are occuring as something tampers with an old stack frame. This has been traced back to blk_abort_queue() leaving a timeout_list pointing to the stack. The reason is that sometimes blk_abort_request() won't delete the timer (if the request is marked as complete but before the timer has been removed, a small race window). Fix this by splicing back from the ususally empty list to the q->timeout_list.

---
 block/blk-timeout.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
block/blk-timeout.c +6 -0
index bbbdc4b..6213123 100644
@@ -224,6 +224,12 @@ void blk_abort_queue(struct request_queue *q)
 	list_for_each_entry_safe(rq, tmp, &list, timeout_list)
 		blk_abort_request(rq);
 
+	/*
+	 * Occasionally, blk_abort_request() will return without
+	 * deleting the element from the list
+	 */
+	list_splice(&list, &q->timeout_list);
+
 	spin_unlock_irqrestore(q->queue_lock, flags);
 
 }
Signature · 1 line
1.5.3.2

I just noticed that this fix is not upstream yet and i have seen test cases hitting this problem.

Quoted 2 lines

Jens, are you going to included this patch, or should this go through the SCSI tree?

It's a block patch, so it goes through the block tree ... it also needs backporting to stable.

James

#3 lore raw
In reply to Christof Schmitt
Quoted 37 lines · Christof Schmitt
Quoted 32 lines · Hannes Reinecke

Very rarely under stress testing of dm, oopses are occuring as something tampers with an old stack frame. This has been traced back to blk_abort_queue() leaving a timeout_list pointing to the stack. The reason is that sometimes blk_abort_request() won't delete the timer (if the request is marked as complete but before the timer has been removed, a small race window). Fix this by splicing back from the ususally empty list to the q->timeout_list.

---
 block/blk-timeout.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
block/blk-timeout.c +6 -0
index bbbdc4b..6213123 100644
@@ -224,6 +224,12 @@ void blk_abort_queue(struct request_queue *q)
 	list_for_each_entry_safe(rq, tmp, &list, timeout_list)
 		blk_abort_request(rq);
 
+	/*
+	 * Occasionally, blk_abort_request() will return without
+	 * deleting the element from the list
+	 */
+	list_splice(&list, &q->timeout_list);
+
 	spin_unlock_irqrestore(q->queue_lock, flags);
 
 }
Signature · 1 line
1.5.3.2

I just noticed that this fix is not upstream yet and i have seen test cases hitting this problem.

Quoted 2 lines

Jens, are you going to included this patch, or should this go through the SCSI tree?

I will include it, and CC stable as well.

Signature · 1 line
Jens Axboe
#4 lore raw
Quoted 38 lines · Jens Axboe
Quoted 37 lines · Christof Schmitt
Quoted 32 lines · Hannes Reinecke

Very rarely under stress testing of dm, oopses are occuring as something tampers with an old stack frame. This has been traced back to blk_abort_queue() leaving a timeout_list pointing to the stack. The reason is that sometimes blk_abort_request() won't delete the timer (if the request is marked as complete but before the timer has been removed, a small race window). Fix this by splicing back from the ususally empty list to the q->timeout_list.

---
 block/blk-timeout.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
block/blk-timeout.c +6 -0
index bbbdc4b..6213123 100644
@@ -224,6 +224,12 @@ void blk_abort_queue(struct request_queue *q)
 	list_for_each_entry_safe(rq, tmp, &list, timeout_list)
 		blk_abort_request(rq);
 
+	/*
+	 * Occasionally, blk_abort_request() will return without
+	 * deleting the element from the list
+	 */
+	list_splice(&list, &q->timeout_list);
+
 	spin_unlock_irqrestore(q->queue_lock, flags);
 
 }
Signature · 1 line
1.5.3.2

I just noticed that this fix is not upstream yet and i have seen test cases hitting this problem.

Quoted 4 lines
Quoted 2 lines

Jens, are you going to included this patch, or should this go through the SCSI tree?

I will include it, and CC stable as well.

Any update on this? 2.6.30-rc3 does not have the patch.

--
Christof Schmitt

#5 lore raw
Quoted 39 lines · Christof Schmitt
Quoted 38 lines · Jens Axboe
Quoted 37 lines · Christof Schmitt
Quoted 32 lines · Hannes Reinecke

Very rarely under stress testing of dm, oopses are occuring as something tampers with an old stack frame. This has been traced back to blk_abort_queue() leaving a timeout_list pointing to the stack. The reason is that sometimes blk_abort_request() won't delete the timer (if the request is marked as complete but before the timer has been removed, a small race window). Fix this by splicing back from the ususally empty list to the q->timeout_list.

---
 block/blk-timeout.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
block/blk-timeout.c +6 -0
index bbbdc4b..6213123 100644
@@ -224,6 +224,12 @@ void blk_abort_queue(struct request_queue *q)
 	list_for_each_entry_safe(rq, tmp, &list, timeout_list)
 		blk_abort_request(rq);
 
+	/*
+	 * Occasionally, blk_abort_request() will return without
+	 * deleting the element from the list
+	 */
+	list_splice(&list, &q->timeout_list);
+
 	spin_unlock_irqrestore(q->queue_lock, flags);
 
 }
Signature · 1 line
1.5.3.2

I just noticed that this fix is not upstream yet and i have seen test cases hitting this problem.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Jens, are you going to included this patch, or should this go through the SCSI tree?

I will include it, and CC stable as well.

Any update on this? 2.6.30-rc3 does not have the patch.

I'll be sure to include it today, I need to fix one more thing before sending a new pull request.

Signature · 1 line
Jens Axboe