]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: tests: fix error messages for test case 4 of extent map tests
authorFilipe Manana <fdmanana@suse.com>
Mon, 4 Dec 2023 16:20:24 +0000 (16:20 +0000)
committerDavid Sterba <dsterba@suse.com>
Fri, 15 Dec 2023 21:59:01 +0000 (22:59 +0100)
In test case 4 for extent maps, if we error out we are supposed to print
in interval but instead of printing a non-inclusive end offset, we are
printing the length of the interval, which makes it confusing. So fix
that to print the exclusive end offset instead.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tests/extent-map-tests.c

index 8602f94cc29d7ff4c585b69ce9fda96339a5f16c..ac64eafad703c774a90f796d7a75dd78a6ca3fec 100644 (file)
@@ -388,13 +388,13 @@ static int __test_case_4(struct btrfs_fs_info *fs_info,
        write_unlock(&em_tree->lock);
        if (ret) {
                test_err("case4 [0x%llx 0x%llx): ret %d",
-                        start, len, ret);
+                        start, start + len, ret);
                goto out;
        }
        if (em && (start < em->start || start + len > extent_map_end(em))) {
                test_err(
 "case4 [0x%llx 0x%llx): ret %d, added wrong em (start 0x%llx len 0x%llx block_start 0x%llx block_len 0x%llx)",
-                        start, len, ret, em->start, em->len, em->block_start,
+                        start, start + len, ret, em->start, em->len, em->block_start,
                         em->block_len);
                ret = -EINVAL;
        }