aboutsummaryrefslogtreecommitdiffstats
path: root/utils.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-06-02 18:18:41 +0200
committerDavid Sterba <dsterba@suse.com>2016-06-03 14:49:42 +0200
commit835ce31a03ffe774dd11dd7aa00a449f57fd090f (patch)
tree3d2c90650a3c1f8e797c09963b1f8eaa23a23bdd /utils.h
parent2171228b200bfd1e1c9e993f7cac6567e6c94609 (diff)
downloadbtrfs-progs-835ce31a03ffe774dd11dd7aa00a449f57fd090f.tar.gz
btrfs-progs-835ce31a03ffe774dd11dd7aa00a449f57fd090f.tar.xz
btrfs-progs-835ce31a03ffe774dd11dd7aa00a449f57fd090f.zip
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>
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils.h b/utils.h
index f48c43e..4fee469 100644
--- a/utils.h
+++ b/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)
{
- return nodesize << 10;
+ return (u64)nodesize << 10;
}
+
static inline u64 btrfs_min_dev_size(u32 nodesize)
{
return 2 * (BTRFS_MKFS_SYSTEM_GROUP_SIZE +