btrfs/14[01]: Use proper helper to get both devid and physical for corruption
authorQu Wenruo <wqu@suse.com>
Thu, 12 Dec 2019 08:31:23 +0000 (16:31 +0800)
committerEryu Guan <guaneryu@gmail.com>
Mon, 6 Jan 2020 08:12:39 +0000 (16:12 +0800)
commit996e2632443d55c95918db7a52d41550840abcca
tree2e49bd64e25417c071c3104b97a7a40e51f19f67
parent29e2be05501ffb62d4d4fed6d3712869cce55152
btrfs/14[01]: Use proper helper to get both devid and physical for corruption

[BUG]
With btrfs-progs v5.4, btrfs/140 and btrfs/141 will fail.

[CAUSE]
Both tests are testing re-silvering of RAID1, thus they need to corrupt
on-disk data.

This requires to do manual logical -> physical bytes mapping in the test
case.
However the test case itself uses too many hard coded helper to grab
physical offset, which will change with mkfs.btrfs.

[FIX]
Use more flex helper, to get both devid and physical for such
corruption.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/btrfs/140
tests/btrfs/140.out
tests/btrfs/141
tests/btrfs/141.out