diff options
| author | Johannes Thumshirn <johannes.thumshirn@wdc.com> | 2025-01-13 20:31:44 +0100 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2025-01-14 15:48:56 +0100 |
| commit | 5a0e38eab76991562e0754a93c2c4160819efb03 (patch) | |
| tree | 125752940dcba5ced1ef2d83cb8f08587c69916e /fs/btrfs/raid-stripe-tree.c | |
| parent | 9257d8632a36d02f02a94e674238bcc1b16db8b3 (diff) | |
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 'fs/btrfs/raid-stripe-tree.c')
| -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]; |