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>