Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146980195
D46024.id141082.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
844 B
Referenced Files
None
Subscribers
None
D46024.id141082.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
@@ -682,7 +682,7 @@
bool
nvme_qpair_process_completions(struct nvme_qpair *qpair)
{
- bool done;
+ bool done = false;
/*
* Interlock with reset / recovery code. This is an usually uncontended
@@ -690,12 +690,12 @@
* and to prevent races with the recovery process called from a timeout
* context.
*/
- if (!mtx_trylock(&qpair->recovery)) {
- qpair->num_recovery_nolock++;
- return (false);
- }
+ mtx_lock(&qpair->recovery);
- done = _nvme_qpair_process_completions(qpair);
+ if (__predict_true(qpair->recovery_state == RECOVERY_NONE))
+ done = _nvme_qpair_process_completions(qpair);
+ else
+ qpair->num_recovery_nolock++; // XXX likely need to rename
mtx_unlock(&qpair->recovery);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 8, 7:38 AM (8 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29399253
Default Alt Text
D46024.id141082.diff (844 B)
Attached To
Mode
D46024: nvme: Always lock and only avoid processing for recovery state
Attached
Detach File
Event Timeline
Log In to Comment