defrag: test $TEST_DEV for extents for ext4 defrag
authorTheodore Ts'o <tytso@mit.edu>
Thu, 9 Jun 2016 18:41:09 +0000 (14:41 -0400)
committerEryu Guan <eguan@redhat.com>
Wed, 15 Jun 2016 07:36:23 +0000 (15:36 +0800)
commit850bc06d52d427beb026f617a151025e3797b034
tree1530fed2e31dbaa39b1a92fcc88fc8a7d96b7b48
parent80ff43c05f4f3f39d4628dc7f796bf997ee1253c
defrag: test $TEST_DEV for extents for ext4 defrag

Commit 902223bdbbf2: "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>
common/defrag