]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
fix _require_scratch_duperemove ordering
authorDarrick J. Wong <djwong@kernel.org>
Mon, 3 Feb 2025 22:00:30 +0000 (14:00 -0800)
committerZorro Lang <zlang@kernel.org>
Tue, 18 Feb 2025 04:42:39 +0000 (12:42 +0800)
Zorro complained that generic/559 stopped working, and I noticed that
the duperemove invocation in the _require_scratch_duperemove function
would fail with:

 Error 2: No such file or directory while getting path to file /opt/file1. Skipping.
 Error 2: No such file or directory while getting path to file /opt/file2. Skipping.
 No dedupe candidates found.
 Gathering file list...

The cause of this is the incorrect placement of _require_scratch_dedupe
after a _scratch_mount.  _require_scratch_dedupe formats, mounts, tests,
and unmounts the scratch filesystem, which means that it should not come
between a _scratch_mount call and code that uses $SCRATCH_MNT.

Cc: <fstests@vger.kernel.org> # v2024.12.22
Fixes: 3b9f5fc7d7d853 ("common: call _require_scratch_dedupe from _require_scratch_duperemove")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/reflink

index 9177c45e70bb3771c04241ded106f6e2df718b72..757f06c1c69fa7eb32ff55240a5e5cba36c602d6 100644 (file)
@@ -80,10 +80,10 @@ _require_scratch_duperemove()
 {
        _require_scratch
        _require_command "$DUPEREMOVE_PROG" duperemove
+       _require_scratch_dedupe
 
        _scratch_mkfs > /dev/null
        _scratch_mount
-       _require_scratch_dedupe
 
        dd if=/dev/zero of="$SCRATCH_MNT/file1" bs=128k count=1 >& /dev/null
        dd if=/dev/zero of="$SCRATCH_MNT/file2" bs=128k count=1 >& /dev/null