btrfs: mark the len field in struct btrfs_ordered_sum as unsigned

[ Upstream commit 6e4b2479ab38b3f949a85964da212295d32102f0 ]

len can't ever be negative, so mark it as an u32 instead of int.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Stable-dep-of: 9e65bfca24cf ("btrfs: fix qgroup_free_reserved_data int overflow")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Christoph Hellwig 2023-05-24 17:03:06 +02:00 committed by Greg Kroah-Hartman
parent ab220f4f5c
commit 820a7802f2
2 changed files with 2 additions and 2 deletions

View File

@ -602,7 +602,7 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
}
sums->bytenr = start;
sums->len = (int)size;
sums->len = size;
offset = (start - key.offset) >> fs_info->sectorsize_bits;
offset *= csum_size;

View File

@ -20,7 +20,7 @@ struct btrfs_ordered_sum {
/*
* this is the length in bytes covered by the sums array below.
*/
int len;
u32 len;
struct list_head list;
/* last field is a variable length array of csums */
u8 sums[];