• Kent Overstreet's avatar
    bcachefs: Fix "trying to move an extent, but nr_replicas=0" · 8cc0e506
    Kent Overstreet authored
    data_update_init() does a bunch of complicated stuff to decide how many
    replicas to add, since we only want to increase an extent's durability
    on an explicit rereplicate, but extent pointers may be on devices with
    different durability settings.
    
    There was a corner case when evacuating a device that had been set to
    durability=0 after data had been written to it, and extents on that
    device had already been rereplicated - then evacuate only needs to drop
    pointers on that device, not move them.
    
    So the assert for !m->op.nr_replicas was spurious; this was a perfectly
    legitimate case that needed to be handled.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    8cc0e506
data_update.c 20.5 KB