Skip to content
Commit da415a09 authored by Nicholas Swenson's avatar Nicholas Swenson Committed by Kent Overstreet
Browse files

bcache: Fix moving_gc deadlocking with a foreground write



Deadlock happened because a foreground write slept, waiting for a bucket
to be allocated. Normally the gc would mark buckets available for invalidation.
But the moving_gc was stuck waiting for outstanding writes to complete.
These writes used the bcache_wq, the same queue foreground writes used.

This fix gives moving_gc its own work queue, so it was still finish moving
even if foreground writes are stuck waiting for allocation. It also makes
work queue a parameter to the data_insert path, so moving_gc can use its
workqueue for writes.

Signed-off-by: default avatarNicholas Swenson <nks@daterainc.com>
Signed-off-by: default avatarKent Overstreet <kmo@daterainc.com>
parent 90db6919
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment