Commit 36b3dc05 authored by Feifei Xu's avatar Feifei Xu Committed by David Sterba

Btrfs: self-tests: Fix test_bitmaps fail on 64k sectorsize

With 64K sectorsize, 1G sized block group cannot span across bitmaps.
To execute test_bitmaps() function, this commit allocates
"BITS_PER_BITMAP * sectorsize + PAGE_SIZE" sized block group.
Reviewed-by: default avatarJosef Bacik <jbacik@fb.com>
Reviewed-by: default avatarChandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: default avatarFeifei Xu <xufeifei@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent ef9f2db3
......@@ -843,7 +843,13 @@ int btrfs_test_free_space_cache(u32 sectorsize, u32 nodesize)
test_msg("Running btrfs free space cache tests\n");
cache = btrfs_alloc_dummy_block_group(1024 * 1024 * 1024, sectorsize);
/*
* For ppc64 (with 64k page size), bytes per bitmap might be
* larger than 1G. To make bitmap test available in ppc64,
* alloc dummy block group whose size cross bitmaps.
*/
cache = btrfs_alloc_dummy_block_group(BITS_PER_BITMAP * sectorsize
+ PAGE_SIZE, sectorsize);
if (!cache) {
test_msg("Couldn't run the tests\n");
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment