• Kent Overstreet's avatar
    bcachefs: Handle race between stripe reuse, invalidate_stripe_to_dev · cb6055e6
    Kent Overstreet authored
    When creating a new stripe, we may reuse an existing stripe that has
    some empty and some nonempty blocks.
    
    Generally, the existing stripe won't change underneath us - except for
    block sector counts, which we copy to the new key in
    ec_stripe_key_update.
    
    But the device removal path can now invalidate stripe pointers to a
    device, and that can race with stripe reuse.
    
    Change ec_stripe_key_update() to check for and resolve this
    inconsistency.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    cb6055e6
extents.h 20.8 KB