mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
btrfs: mark the len field in struct btrfs_ordered_sum as unsigned
[ Upstream commit 6e4b2479ab ]
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:
committed by
Greg Kroah-Hartman
parent
ab220f4f5c
commit
820a7802f2
@@ -602,7 +602,7 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
|
|||||||
}
|
}
|
||||||
|
|
||||||
sums->bytenr = start;
|
sums->bytenr = start;
|
||||||
sums->len = (int)size;
|
sums->len = size;
|
||||||
|
|
||||||
offset = (start - key.offset) >> fs_info->sectorsize_bits;
|
offset = (start - key.offset) >> fs_info->sectorsize_bits;
|
||||||
offset *= csum_size;
|
offset *= csum_size;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ struct btrfs_ordered_sum {
|
|||||||
/*
|
/*
|
||||||
* this is the length in bytes covered by the sums array below.
|
* this is the length in bytes covered by the sums array below.
|
||||||
*/
|
*/
|
||||||
int len;
|
u32 len;
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
/* last field is a variable length array of csums */
|
/* last field is a variable length array of csums */
|
||||||
u8 sums[];
|
u8 sums[];
|
||||||
|
|||||||
Reference in New Issue
Block a user