diff options
author | Johannes Thumshirn <johannes.thumshirn@wdc.com> | 2025-01-13 22:31:44 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2025-01-14 17:48:56 +0300 |
commit | 5a0e38eab76991562e0754a93c2c4160819efb03 (patch) | |
tree | 125752940dcba5ced1ef2d83cb8f08587c69916e | |
parent | 9257d8632a36d02f02a94e674238bcc1b16db8b3 (diff) | |
download | linux-5a0e38eab76991562e0754a93c2c4160819efb03.tar.xz |
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>
-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]; |