summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaohiro Aota <naohiro.aota@wdc.com>2026-01-05 11:19:05 +0300
committerDavid Sterba <dsterba@suse.com>2026-01-09 19:41:48 +0300
commitd5fac7ddb38cd627a8fc2b87e5b588b48a803956 (patch)
tree3ed18685367c620845409b3fb6725fb1a646b51a
parentbe1c2e8afe3ac4a4f15a13f6844619c2cf47b1d1 (diff)
downloadlinux-d5fac7ddb38cd627a8fc2b87e5b588b48a803956.tar.xz
btrfs: tests: fix return 0 on rmap test failure
In test_rmap_blocks(), we have ret = 0 before checking the results. We need to set it to -EINVAL, so that a mismatching result will return -EINVAL not 0. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/tests/extent-map-tests.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/tests/extent-map-tests.c b/fs/btrfs/tests/extent-map-tests.c
index 0b9f25dd1a68..aabf825e8d7b 100644
--- a/fs/btrfs/tests/extent-map-tests.c
+++ b/fs/btrfs/tests/extent-map-tests.c
@@ -1059,6 +1059,7 @@ static int test_rmap_block(struct btrfs_fs_info *fs_info,
if (out_stripe_len != BTRFS_STRIPE_LEN) {
test_err("calculated stripe length doesn't match");
+ ret = -EINVAL;
goto out;
}
@@ -1066,12 +1067,14 @@ static int test_rmap_block(struct btrfs_fs_info *fs_info,
for (i = 0; i < out_ndaddrs; i++)
test_msg("mapped %llu", logical[i]);
test_err("unexpected number of mapped addresses: %d", out_ndaddrs);
+ ret = -EINVAL;
goto out;
}
for (i = 0; i < out_ndaddrs; i++) {
if (logical[i] != test->mapped_logical[i]) {
test_err("unexpected logical address mapped");
+ ret = -EINVAL;
goto out;
}
}