]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
xfs/178: don't fail when SCRATCH_DEV contains random xfs superblocks
authorDarrick J. Wong <djwong@kernel.org>
Thu, 12 Oct 2023 15:09:22 +0000 (08:09 -0700)
committerZorro Lang <zlang@kernel.org>
Sun, 22 Oct 2023 06:32:30 +0000 (14:32 +0800)
commitcdd66286292642bcb305456ecbfa021f462d9315
tree4a5ca6a901f829aa5e68d03bac61cfa29d1128a3
parent59299b65ac8f15935ab45e7920cbfda8a6beffd1
xfs/178: don't fail when SCRATCH_DEV contains random xfs superblocks

When I added an fstests config for "RAID" striping (aka MKFS_OPTIONS='-d
su=128k,sw=4'), I suddenly started seeing this test fail sporadically
with:

  --- /tmp/fstests/tests/xfs/178.out 2023-07-11 12:18:21.714970364 -0700
  +++ /var/tmp/fstests/xfs/178.out.bad 2023-07-25 22:05:39.756000000 -0700
  @@ -10,6 +10,20 @@ bad primary superblock - bad magic numbe

   attempting to find secondary superblock...
   found candidate secondary superblock...
  +unable to verify superblock, continuing...
  +found candidate secondary superblock...
  +error reading superblock 1 -- seek to offset 584115421184 failed
  +unable to verify superblock, continuing...
  +found candidate secondary superblock...
  +error reading superblock 1 -- seek to offset 584115421184 failed
  +unable to verify superblock, continuing...
  +found candidate secondary superblock...
  +error reading superblock 1 -- seek to offset 584115421184 failed
  +unable to verify superblock, continuing...
  +found candidate secondary superblock...
  +error reading superblock 1 -- seek to offset 584115421184 failed
  +unable to verify superblock, continuing...
  +found candidate secondary superblock...
  +error reading superblock 1 -- seek to offset 584115421184 failed
  +unable to verify superblock, continuing...
  +found candidate secondary superblock...
  +error reading superblock 1 -- seek to offset 584115421184 failed
  +unable to verify superblock, continuing...
  +found candidate secondary superblock...
   verified secondary superblock...
   writing modified primary superblock
   sb root inode INO inconsistent with calculated value INO

Eventually I tracked this down to a mis-interaction between the test,
xfs_repair, and the storage device.

If the device doesn't support discard, _scratch_mkfs won't zero the
entire disk to remove old dead superblocks that might have been written
by previous tests.  After we shatter the primary super, the xfs_repair
scanning code can still trip over those old supers when it goes looking
for secondary supers.

Most of the time it finds the actual AG 1 secondary super, but sometimes
it finds ghosts from previous formats.  When that happens, xfs_repair
will talk quite a bit about those failed secondaries, even if it
eventually finds an acceptable secondary sb and completes the repair.

Filter out the messages about secondary supers.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/xfs/178
tests/xfs/178.out