]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: fix deletion of a range spanning parts two RAID stripe extents
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Mon, 13 Jan 2025 19:31:47 +0000 (20:31 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 14 Jan 2025 14:51:24 +0000 (15:51 +0100)
commit76643119045eed639a3334370cba30c54c4074c1
tree3942c854298307bf24a5e46efb92ad90760517cc
parent50cae2ca69561cbd9a90308ad2a14a442d230662
btrfs: fix deletion of a range spanning parts two RAID stripe extents

When a user requests the deletion of a range that spans multiple stripe
extents and btrfs_search_slot() returns us the second RAID stripe extent,
we need to pick the previous item and truncate it, if there's still a
range to delete left, move on to the next item.

The following diagram illustrates the operation:

 |--- RAID Stripe Extent ---||--- RAID Stripe Extent ---|
        |--- keep  ---|--- drop ---|

While at it, comment the trivial case of a whole item delete as well.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/raid-stripe-tree.c