btrfs/215: avoid false alert for subpage case
authorQu Wenruo <wqu@suse.com>
Mon, 17 May 2021 09:29:22 +0000 (17:29 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 23 May 2021 13:42:38 +0000 (21:42 +0800)
[BUG]
When running btrfs/215 with 64K page size, 4K sectorsize (subpage RW
support), it fails with the following error:
btrfs/215       [failed, exit status 1]- output mismatch (see ~/xfstests-dev/results//btrfs/215.out.bad)
    --- tests/btrfs/215.out     2021-03-19 16:34:26.069634953 +0800
    +++ ~/xfstests-dev/results//btrfs/215.out.bad      2021-05-17 16:52:34.743514224 +0800
    @@ -1,2 +1,3 @@
     QA output created by 215
    -Silence is golden
    +Errors: 8 expected: 2
    +(see ~/xfstests-dev/results//btrfs/215.full for details)
    ...
    (Run 'diff -u ~/xfstests-dev/tests/btrfs/215.out ~/xfstests-dev/results//btrfs/215.out.bad'  to see the entire diff)

[CAUSE]
For subpage case, btrfs still tries to read the full page, other than
read just one sector for PAGE_SIZE == sectorsize case.

This means for the 2 sectors corrupted case, since they are in the same
page, all the errors will be reported.

[FIX]
Change the following values:
- filesize
  Now it's 8 * pagesize.

- expected error number
  Now it's 2 * sectors_per_page or 6 * sectors_per_page.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>

No differences found