mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-27 00:22:22 +00:00
btrfs-progs: use wider int type in btrfs_min_global_blk_rsv_size
We know nodesize should not overflow with the shift, but le'ts make the code correct if the resulting type can store the full value. Resolves-coverity-id: 1358120 Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
2171228b20
commit
835ce31a03
3
utils.h
3
utils.h
@ -209,8 +209,9 @@ int get_subvol_info(const char *fullpath, struct root_info *get_ri);
|
|||||||
*/
|
*/
|
||||||
static inline u64 btrfs_min_global_blk_rsv_size(u32 nodesize)
|
static inline u64 btrfs_min_global_blk_rsv_size(u32 nodesize)
|
||||||
{
|
{
|
||||||
return nodesize << 10;
|
return (u64)nodesize << 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline u64 btrfs_min_dev_size(u32 nodesize)
|
static inline u64 btrfs_min_dev_size(u32 nodesize)
|
||||||
{
|
{
|
||||||
return 2 * (BTRFS_MKFS_SYSTEM_GROUP_SIZE +
|
return 2 * (BTRFS_MKFS_SYSTEM_GROUP_SIZE +
|
||||||
|
Loading…
Reference in New Issue
Block a user