提交 ccfada1f 编写于 作者: D David Sterba

btrfs: tests: return error from all extent map test cases

The way the extent map tests handle errors does not conform to the rest
of the suite, where the first failure is reported and then it stops.
Do the same now that we have the errors returned from all the functions.
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 7c6f6700
......@@ -275,12 +275,20 @@ static int __test_case_3(struct btrfs_fs_info *fs_info,
* -> add_extent_mapping()
* -> add_extent_mapping()
*/
static void test_case_3(struct btrfs_fs_info *fs_info,
static int test_case_3(struct btrfs_fs_info *fs_info,
struct extent_map_tree *em_tree)
{
__test_case_3(fs_info, em_tree, 0);
__test_case_3(fs_info, em_tree, SZ_8K);
__test_case_3(fs_info, em_tree, (12 * 1024ULL));
int ret;
ret = __test_case_3(fs_info, em_tree, 0);
if (ret)
return ret;
ret = __test_case_3(fs_info, em_tree, SZ_8K);
if (ret)
return ret;
ret = __test_case_3(fs_info, em_tree, (12 * 1024ULL));
return ret;
}
static int __test_case_4(struct btrfs_fs_info *fs_info,
......@@ -379,11 +387,17 @@ static int __test_case_4(struct btrfs_fs_info *fs_info,
* # handle -EEXIST when adding
* # [0, 32K)
*/
static void test_case_4(struct btrfs_fs_info *fs_info,
static int test_case_4(struct btrfs_fs_info *fs_info,
struct extent_map_tree *em_tree)
{
__test_case_4(fs_info, em_tree, 0);
__test_case_4(fs_info, em_tree, SZ_4K);
int ret;
ret = __test_case_4(fs_info, em_tree, 0);
if (ret)
return ret;
ret = __test_case_4(fs_info, em_tree, SZ_4K);
return ret;
}
int btrfs_test_extent_map(void)
......@@ -412,13 +426,19 @@ int btrfs_test_extent_map(void)
extent_map_tree_init(em_tree);
test_case_1(fs_info, em_tree);
test_case_2(fs_info, em_tree);
test_case_3(fs_info, em_tree);
test_case_4(fs_info, em_tree);
ret = test_case_1(fs_info, em_tree);
if (ret)
goto out;
ret = test_case_2(fs_info, em_tree);
if (ret)
goto out;
ret = test_case_3(fs_info, em_tree);
if (ret)
goto out;
ret = test_case_4(fs_info, em_tree);
kfree(em_tree);
out:
kfree(em_tree);
btrfs_free_dummy_fs_info(fs_info);
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册