Skip to content

Commit 5a0e38e

Browse files
morbidrsakdave
authored andcommitted
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 <[email protected]> Signed-off-by: Johannes Thumshirn <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 9257d86 commit 5a0e38e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/btrfs/raid-stripe-tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ static void btrfs_partially_delete_raid_extent(struct btrfs_trans_handle *trans,
2828
.offset = newlen,
2929
};
3030

31+
ASSERT(newlen > 0);
3132
ASSERT(oldkey->type == BTRFS_RAID_STRIPE_KEY);
3233

3334
leaf = path->nodes[0];

0 commit comments

Comments
 (0)