Kernel hang on drive pull caused by regression introduced by commit 287922eb0b18
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
High
|
Joseph Salisbury | ||
Xenial |
Fix Released
|
High
|
Joseph Salisbury |
Bug Description
== SRU Justification ==
The following commit was applied to Xenial and introduced this
regression:
287922eb0b18 ("block: defer timeouts to a workqueue")
This regression was introduced in mainline as of v4.5-rc1. Bionc was
also affected by this regression, but it already go the fix when commit
4e9b6f20828a was applied to mainline in v4.15-rc1.
The regression caused a kernel hang because the HPSA driver has a tendency
to aggressively remove missing devices.
== Fix ==
4e9b6f20828a ("block: Fix a race between blk_cleanup_queue() and timeout handling")
== Regression Potential ==
Low. This commit fixes a regression and has been cc'd to stable, so it
has had addition upstream review. This commit is already applied to
Bionic and Cosmic.
== Test Case ==
A test kernel was built with this patch and tested by the original bug reporter.
The bug reporter states the test kernel resolved the bug.
A bug was introduced when backporting the fix for http://
This patch changes the context in which timeout work is scheduled for block devices in the kernel. Previously, timeout work was executed directly from the timer callback that fired when a deadline was met. After the patch, timeout work is scheduled using a background work queue. This means that by the time the work executes, the device queue which originally scheduled the work could be torn down. In order to prevent this, the patch takes a reference on the device queue when executing the timeout work.
The problem is that the last reference to this queue can be removed before the timeout work can be executed. During teardown, the block system executes a freeze followed by a drain. The freeze drops the last reference on the queue. The drain tries to clean up any outstanding work, including timeout work. After a freeze, the timeout work in the background queue is unable to obtain a reference, and exits early without completing work. The work is now permanently stuck in the queue and it will never be completed. The drain in the device teardown path spins indefinitely.
The bug manifests as a hang that looks like this:
[<ffffffff81829
[<ffffffffc014a
[<ffffffff810c3
[<ffffffffc014b
[<ffffffff8109a
[<ffffffff8109a
[<ffffffff8109a
[<ffffffff810a0
[<ffffffff810a0
[<ffffffff8182e
[<ffffffff810a0
The fix exists upstream. It applies, builds, and runs cleanly on Ubuntu's most recent 4.4 kernel.
https:/
We hit this bug nearly 100% of the time on some of our HP hardware. The HPSA driver has a tendency to aggressively remove missing devices, so it widens the race. As a result, we've been building our own kernel with this patch applied. It would be really nice if we could get it into mainline Ubuntu.
Let me know what additional information is needed. Thanks!
CVE References
Changed in linux (Ubuntu): | |
assignee: | nobody → Joseph Salisbury (jsalisbury) |
importance: | Undecided → High |
status: | Confirmed → In Progress |
Changed in linux (Ubuntu Xenial): | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Joseph Salisbury (jsalisbury) |
summary: |
- Kernel hang on drive pull caused by incomplete backport for bug 1597908 + Kernel hang on drive pull caused by regression introduced by commit + 287922eb0b18 |
Changed in linux (Ubuntu Xenial): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu): | |
status: | In Progress → Fix Released |
tags: | added: cscc |
This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:
apport-collect 1791790
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.