summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tests
diff options
context:
space:
mode:
authorFeifei Xu <xufeifei@linux.vnet.ibm.com>2016-06-01 13:18:24 +0200
committerDavid Sterba <dsterba@suse.com>2016-06-02 19:22:49 +0200
commit0ef6447a3d2f014e49069c4da33f905ed803aa2a (patch)
tree4a6640e63442d44d32bedc2a6c854d998bc79872 /fs/btrfs/tests
parentBtrfs: test_check_exists: Fix infinite loop when searching for free space ent... (diff)
downloadlinux-0ef6447a3d2f014e49069c4da33f905ed803aa2a.tar.xz
linux-0ef6447a3d2f014e49069c4da33f905ed803aa2a.zip
Btrfs: Fix integer overflow when calculating bytes_per_bitmap
On ppc64, bytes_per_bitmap will be (65536*8*65536). Hence append UL to fix integer overflow. Reviewed-by: Josef Bacik <jbacik@fb.com> Reviewed-by: Chandan Rajendra <chandan@linux.vnet.ibm.com> Signed-off-by: Feifei Xu <xufeifei@linux.vnet.ibm.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tests')
-rw-r--r--fs/btrfs/tests/free-space-tests.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/tests/free-space-tests.c b/fs/btrfs/tests/free-space-tests.c
index 0eeb8f3d6b67..f3756d6b9ba2 100644
--- a/fs/btrfs/tests/free-space-tests.c
+++ b/fs/btrfs/tests/free-space-tests.c
@@ -22,7 +22,7 @@
#include "../disk-io.h"
#include "../free-space-cache.h"
-#define BITS_PER_BITMAP (PAGE_SIZE * 8)
+#define BITS_PER_BITMAP (PAGE_SIZE * 8UL)
/*
* This test just does basic sanity checking, making sure we can add an extent