On Thu, Jul 28, 2022 at 01:16:28PM -0700, Christoph Hellwig wrote: > On Thu, Jul 28, 2022 at 11:17:15AM -0700, Darrick J. Wong wrote: > > +SCRATCH_DEV=$metadump_img _scratch_xfs_repair -n &>> $seqres.full || \ > > + echo "xfs_repair on restored fs returned $?" > > Wouldn;t it make more sense to have a version of _scratch_xfs_repair > rather than doing a somewhat unexpected override of this global > variable? Any detailed ideas about how to have a new version of _scratch_xfs_repair? I'll keep this patch unmerged this week, before Darrick reply your discussion. Currently a few cases do some overriding [1] before calling _scratch_* helpers. And good news is this kind of "override" affect only the environment seen by its follow command/function. So I generally don't have objection if it works well. But it's welcome if we have a better idea to deal with this kind of requirement :) Thanks, Zorro [1] $ grep -rsn SCRATCH_DEV= tests/ tests/btrfs/160:36:old_SCRATCH_DEV=$SCRATCH_DEV tests/btrfs/160:38:SCRATCH_DEV=$DMERROR_DEV tests/btrfs/146:39:old_SCRATCH_DEV=$SCRATCH_DEV tests/btrfs/146:41:SCRATCH_DEV=$DMERROR_DEV tests/btrfs/146:62:SCRATCH_DEV=$old_SCRATCH_DEV tests/xfs/507:198:LARGE_SCRATCH_DEV=yes _check_xfs_filesystem $loop_dev none none tests/xfs/185:75:SCRATCH_DEV="$ddloop" tests/xfs/234:56:SCRATCH_DEV=$TEST_DIR/image _scratch_mount tests/xfs/234:57:SCRATCH_DEV=$TEST_DIR/image _scratch_unmount tests/xfs/336:68:SCRATCH_DEV=$TEST_DIR/image _scratch_mount tests/xfs/336:69:SCRATCH_DEV=$TEST_DIR/image _scratch_unmount tests/xfs/157:61: SCRATCH_DEV=$orig_ddev tests/xfs/157:76:SCRATCH_DEV=$fake_datafile tests/xfs/129:56:SCRATCH_DEV=$TEST_DIR/image _scratch_mount tests/xfs/129:57:SCRATCH_DEV=$TEST_DIR/image _scratch_unmount tests/ceph/005:27:SCRATCH_DEV="$SCRATCH_DEV/quota-dir" _scratch_mount tests/ceph/005:29:SCRATCH_DEV="$SCRATCH_DEV_ORIG/quota-dir" _scratch_unmount tests/ceph/005:31:SCRATCH_DEV="$SCRATCH_DEV_ORIG/quota-dir/subdir" _scratch_mount tests/ceph/005:33:SCRATCH_DEV="$SCRATCH_DEV_ORIG/quota-dir/subdir" _scratch_unmount >