Skip to content

Commit

Permalink
btrfs: selftests: check for correct return value of failed lookup
Browse files Browse the repository at this point in the history
Commit 5e72aab ("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>
  • Loading branch information
Johannes Thumshirn authored and David Sterba committed Jan 14, 2025
1 parent dc14ba1 commit d44d3d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/tests/raid-stripe-tree-tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d44d3d7

Please sign in to comment.