]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
xfs/336: port to common/metadump
authorDarrick J. Wong <djwong@kernel.org>
Sun, 5 Jan 2025 21:50:14 +0000 (13:50 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 23 Jan 2025 21:19:57 +0000 (13:19 -0800)
commit44b4ba8ac4c0ad876e7ee255f70c2c3c8ecd5731
treeb4089bee312c1a14e74d633c138712664e9b18b9
parent8e6352ded855f9dc8c2cfe7feb702d7ccd62b9b4
xfs/336: port to common/metadump

xfs/336 does this somewhat sketchy thing where it mdrestores into a
regular file, and then does this to validate the restored metadata:

SCRATCH_DEV=$TEST_DIR/image _scratch_mount

Unfortunately, commit 1a49022fab9b4d causes the following regression:

 --- /tmp/fstests/tests/xfs/336.out      2024-11-12 16:17:36.733447713 -0800
 +++ /var/tmp/fstests/xfs/336.out.bad    2025-01-04 19:10:39.861871114 -0800
 @@ -5,4 +5,5 @@ Create big file
  Explode the rtrmapbt
  Create metadump file
  Restore metadump
 -Check restored fs
 +Usage: _set_fs_sysfs_attr <mounted_device> <attr> <content>
 +(see /var/tmp/fstests/xfs/336.full for details)

This is due to the fact that SCRATCH_DEV is temporarily reassigned to
the regular file.  That path is passed straight through _scratch_mount
to _xfs_prepare_for_eio_shutdown, but that helper _fails because the
"dev" argument isn't actually a path to a block device.

Fix this by porting it to the new common/metadump code that we merged
last year.

Cc: <fstests@vger.kernel.org> # v2024.12.08
Fixes: 1a49022fab9b4d ("fstests: always use fail-at-unmount semantics for XFS")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
tests/xfs/336
tests/xfs/336.out