Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162770608
D41866.id127404.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D41866.id127404.diff
View Options
diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c
--- a/sys/dev/nvme/nvme_qpair.c
+++ b/sys/dev/nvme/nvme_qpair.c
@@ -945,6 +945,15 @@
{
struct nvme_tracker *tr;
+ /*
+ * nvme_complete_tracker must be called without the qpair lock held. It
+ * takes the lock to adjust outstanding_tr list, so make sure we don't
+ * have it yet (since this is a general purpose routine). Since we
+ * restart the list scan when we complete one tracker, it's safe to do
+ * this w/o the lock.
+ */
+ mtx_assert(&qpair->lock, MA_UNOWNED);
+
tr = TAILQ_FIRST(&qpair->outstanding_tr);
while (tr != NULL) {
if (tr->req->cmd.opc == NVME_OPC_ASYNC_EVENT_REQUEST) {
@@ -961,6 +970,7 @@
void
nvme_admin_qpair_destroy(struct nvme_qpair *qpair)
{
+ mtx_assert(&qpair->lock, MA_UNOWNED);
nvme_admin_qpair_abort_aers(qpair);
nvme_qpair_destroy(qpair);
@@ -1410,12 +1420,13 @@
nvme_admin_qpair_disable(struct nvme_qpair *qpair)
{
mtx_lock(&qpair->recovery);
- mtx_lock(&qpair->lock);
+ mtx_lock(&qpair->lock);
nvme_qpair_disable(qpair);
+ mtx_unlock(&qpair->lock);
+
nvme_admin_qpair_abort_aers(qpair);
- mtx_unlock(&qpair->lock);
mtx_unlock(&qpair->recovery);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 17, 5:26 PM (20 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35172098
Default Alt Text
D41866.id127404.diff (1 KB)
Attached To
Mode
D41866: nvme: Fix locking protocol violation
Attached
Detach File
Event Timeline
Log In to Comment