diff options
author | 2025-01-13 20:31:44 +0100 | |
---|---|---|
committer | 2025-01-14 15:48:56 +0100 | |
commit | 5a0e38eab76991562e0754a93c2c4160819efb03 (patch) | |
tree | 125752940dcba5ced1ef2d83cb8f08587c69916e | |
parent | btrfs: don't try to delete RAID stripe-extents if we don't need to (diff) | |
download | wireguard-linux-5a0e38eab76991562e0754a93c2c4160819efb03.tar.xz wireguard-linux-5a0e38eab76991562e0754a93c2c4160819efb03.zip |
btrfs: assert RAID stripe-extent length is always greater than 0
When modifying a RAID stripe-extent, ASSERT() that the length of the new
RAID stripe-extent is always greater than 0.
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to '')
-rw-r--r-- | fs/btrfs/raid-stripe-tree.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/raid-stripe-tree.c b/fs/btrfs/raid-stripe-tree.c index be923144cc85..0c351eda3551 100644 --- a/fs/btrfs/raid-stripe-tree.c +++ b/fs/btrfs/raid-stripe-tree.c @@ -28,6 +28,7 @@ static void btrfs_partially_delete_raid_extent(struct btrfs_trans_handle *trans, .offset = newlen, }; + ASSERT(newlen > 0); ASSERT(oldkey->type == BTRFS_RAID_STRIPE_KEY); leaf = path->nodes[0]; |