• Qu Wenruo's avatar
    btrfs: tests: remove invalid extent-io test · b1d51f67
    Qu Wenruo authored
    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, e.g:
    
    	len = (sectorsize < BTRFS_MAX_METADATA_BLOCKSIZE)
    		? sectorsize * 4 : sectorsize;
    
      In above case, if we have 32K page size, then we will get a length of
      128K, which is beyond max node size, and obviously invalid.
    
      The common page size goes up to 64K so we haven't hit that
    
    - Invalid extent buffer bytenr
      For 64K page size, the only combination we're going to test is
      sectorsize = nodesize = 64K.
      However, in that case we will try to test an eb which bytenr is not
      sectorsize aligned:
    
    	/* Do it over again with an extent buffer which isn't page-aligned. */
    	eb = __alloc_dummy_extent_buffer(fs_info, nodesize / 2, len);
    
      Sector alignment is a hard requirement for any sector size.
      The only exception is superblock. But anything else should follow
      sector size alignment.
    
      This is definitely an invalid test case.
    
    This patch will fix both problems by:
    
    - Honor the sectorsize/nodesize combination
      Now we won't bother to hand-craft the 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.
    
    Please note that, later subpage related cleanup will reduce
    extent_buffer::pages[] to exactly what we need, making the sector
    unaligned extent buffer operations cause problems.
    
    Since only extent_io self tests utilize this, this patch is required for
    all later cleanup/refactoring.
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    b1d51f67
extent-io-tests.c 13.8 KB