• Johannes Thumshirn's avatar
    btrfs: scrub: implement raid stripe tree support · 9acaa641
    Johannes Thumshirn authored
    A filesystem that uses the raid stripe tree for logical to physical
    address translation can't use the regular scrub path, that reads all
    stripes and then checks if a sector is unused afterwards.
    
    When using the raid stripe tree, this will result in lookup errors, as
    the stripe tree doesn't know the requested logical addresses.
    
    In case we're scrubbing a filesystem which uses the RAID stripe tree for
    multi-device logical to physical address translation, perform an extra
    block mapping step to get the real on-disk stripe length from the stripe
    tree when scrubbing the sectors.
    
    This prevents a double completion of the btrfs_bio caused by splitting the
    underlying bio and ultimately a use-after-free.
    Signed-off-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    9acaa641
raid-stripe-tree.c 6.45 KB