From b23178ad1e092cdc2a6796e2d3cf012820552a30 Mon Sep 17 00:00:00 2001 From: Johannes Thumshirn Date: Tue, 26 Nov 2024 14:20:58 +0100 Subject: [PATCH] btrfs: fix tail delete of RAID stripe-extents Fix tail delete of RAID stripe-extents, if there is a range to be deleted as well after the tail delete of the extent. Signed-off-by: Johannes Thumshirn --- fs/btrfs/raid-stripe-tree.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/raid-stripe-tree.c b/fs/btrfs/raid-stripe-tree.c index 5f85a7e4e2dd8e..8e9a3ce3712693 100644 --- a/fs/btrfs/raid-stripe-tree.c +++ b/fs/btrfs/raid-stripe-tree.c @@ -161,7 +161,14 @@ int btrfs_delete_raid_extent(struct btrfs_trans_handle *trans, u64 start, u64 le btrfs_partially_delete_raid_extent(trans, path, &key, diff, 0); - break; + + start += diff; + length -= diff; + if (length == 0) + break; + + btrfs_release_path(path); + continue; } /*