Skip to content
Commit 6d3d1a9c authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcache: bugfix for race between moving_gc and bucket_invalidate



There is a possibility for a bucket to be invalidated by the allocator
while moving_gc was copying it's contents to another bucket, if the
bucket only held cached data. To prevent this moving checks for
a stale ptr (to an invalidated bucket), before and after reads.
It it finds one, it simply ignores moving that data. This only
affects bcache if the moving_gc was turned on, note that it's
off by default.

Signed-off-by: default avatarNicholas Swenson <nks@daterainc.com>
Signed-off-by: default avatarKent Overstreet <kmo@daterainc.com>
parent bf0a628a
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