• Kent Overstreet's avatar
    bcachefs: Data update path no longer leaves cached replicas · 25d8f405
    Kent Overstreet authored
    It turns out that it's currently impossible to invalidate buckets
    containing only cached data if they're part of a stripe. The normal
    bucket invalidate path can't do it because we have to be able to
    incerement the bucket's gen, which isn't correct becasue it's still a
    member of the stripe - and the bucket invalidate path makes the bucket
    availabel for reuse right away, which also isn't correct for buckets in
    stripes.
    
    What would work is invalidating cached data by following backpointers,
    except that cached replicas don't currently get backpointers - because
    they would be awkward for the existing bucket invalidate path to delete
    and they haven't been needed elsewhere.
    
    So for the time being, to prevent running out of space in stripes,
    switch the data update path to not leave cached replicas; we may revisit
    this in the future.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    25d8f405
data_update.c 14.8 KB