Re: [PATCH 01/17] btrfs: extent-io-tests: remove invalid tests

Nikolay Borisov
2020-09-09T16:04:06Z

On 8.09.20 г. 10:52 ч., Qu Wenruo wrote:
> In extent-io-test, there are two invalid tests:
> - Invalid nodesize for test_eb_bitmaps()
> Instead of the sectorsize and nodesize combination passed in, we're
> always using hand-crafted nodesize.
> Although it has some extra check for 64K page size, we can still hit
> a case where PAGE_SIZE == 32K, then we got 128K nodesize which is
> larger than max valid node size.
>
> Thankfully most machines are either 4K or 64K page size, thus we
> haven't yet hit such case.
>
> - Invalid extent buffer bytenr
> For 64K page size, the only combination we're going to test is
> sectorsize = nodesize = 64K.
> In that case, we'll try to create an extent buffer with 32K bytenr,
> which is not aligned to sectorsize thus invalid.
>
> This patch will fix both problems by:
> - Honor the sectorsize/nodesize combination
> Now we won't bother to hand-craft a strange length and use it as
> nodesize.
>
> - Use sectorsize as the 2nd run extent buffer start
> This would test the case where extent buffer is aligned to sectorsize
> but not always aligned to nodesize.
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Shouldn't you also modify btrfs_run_sanity_tests to extend
test_sectorsize such that it contains a subpage blocksize? As it stands
now test_eb_bitmaps will be called with sectorsize always being
PAGE_SIZE and nodesize being a multiple of the PAGE_SIZE i.e for a 4k
page that would be 4/8/16/32/64 k nodes

<snip>