Skip to content

Commit

Permalink
btrfs: mark the len field in struct btrfs_ordered_sum as unsigned
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and kdave committed Jun 19, 2023
1 parent e9cb93b commit 6e4b247
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/btrfs/file-item.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ int btrfs_lookup_csums_list(struct btrfs_root *root, u64 start, u64 end,
}

sums->bytenr = start;
sums->len = (int)size;
sums->len = size;

offset = bytes_to_csum_size(fs_info, start - key.offset);

Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/ordered-data.h
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down

0 comments on commit 6e4b247

Please sign in to comment.