mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 21:45:08 -04:00
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. Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
committed by
David Sterba
parent
a678543e60
commit
50cae2ca69
@@ -119,11 +119,18 @@ int btrfs_delete_raid_extent(struct btrfs_trans_handle *trans, u64 start, u64 le
|
||||
* length to the new size and then re-insert the item.
|
||||
*/
|
||||
if (found_start < start) {
|
||||
u64 diff = start - found_start;
|
||||
u64 diff_start = start - found_start;
|
||||
|
||||
btrfs_partially_delete_raid_extent(trans, path, &key,
|
||||
diff, 0);
|
||||
break;
|
||||
diff_start, 0);
|
||||
|
||||
start += (key.offset - diff_start);
|
||||
length -= (key.offset - diff_start);
|
||||
if (length == 0)
|
||||
break;
|
||||
|
||||
btrfs_release_path(path);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user