mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
defrag: test $TEST_DEV for extents for ext4 defrag
Commit 902223bdbb: "defrag: require extents support for ext4
defrag" added a test to make sure the ext4 file system has extents
enabled by testing the scratch device. Unfortunately at the time
when _require_defrag is run, the scratch file system hasn't been
initialized yet by the test, so its contents are undefined.
If the previous test explicitly creates a file system with extents
disabled on $SCRATCH_DEV (such as ext4/306), then subsequent tests
(e.g., ext4/307 and ext4/306) will refuse to run.
Fix this by testing $TEST_DEV instead of $SCRATCH_DEV.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
+1
-1
@@ -33,7 +33,7 @@ _require_defrag()
|
||||
else
|
||||
DEFRAG_PROG="$E4DEFRAG_PROG"
|
||||
fi
|
||||
dumpe2fs -h $SCRATCH_DEV 2> /dev/null | grep -wq extent || \
|
||||
dumpe2fs -h $TEST_DEV 2> /dev/null | grep -wq extent || \
|
||||
_notrun "file system does not have extents, needed for defrag"
|
||||
;;
|
||||
btrfs)
|
||||
|
||||
Reference in New Issue
Block a user