]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: selftests: check for correct return value of failed lookup
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Mon, 13 Jan 2025 19:31:50 +0000 (20:31 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 14 Jan 2025 14:52:30 +0000 (15:52 +0100)
Commit 5e72aabc1fff ("btrfs: return ENODATA in case RST lookup fails")
changed btrfs_get_raid_extent_offset()'s return value to ENODATA in case
the RAID stripe-tree lookup failed.

Adjust the test cases which check for absence of a given range to check
for ENODATA as return value in this case.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tests/raid-stripe-tree-tests.c

index 5801142ba7c3a43ea075a1f7aafe704c8e1e075b..446c46d89152a5a903476c5ab1abef81978c2aef 100644 (file)
@@ -125,7 +125,7 @@ static int test_front_delete(struct btrfs_trans_handle *trans)
        }
 
        ret = btrfs_get_raid_extent_offset(fs_info, logical, &len, map_type, 0, &io_stripe);
-       if (!ret) {
+       if (ret != -ENODATA) {
                ret = -EINVAL;
                test_err("lookup of RAID extent [%llu, %llu] succeeded, should fail",
                         logical, logical + SZ_32K);