defrag: require extents support for ext4 defrag
authorTheodore Ts'o <tytso@mit.edu>
Sun, 28 Feb 2016 23:18:17 +0000 (10:18 +1100)
committerDave Chinner <david@fromorbit.com>
Sun, 28 Feb 2016 23:18:17 +0000 (10:18 +1100)
The e4defrag program requires the use of fallocate, which in turn
means that the file system must have extents.  Enforce this
requirement so we don't get test failure noise when testing ext4's
ext3 compatibility.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/defrag

index 942593e122dc1e237d5592f6b849503d114995f7..6fbf8304eab81d22d86bd6511b42e78180ea8a07 100644 (file)
@@ -27,7 +27,9 @@ _require_defrag()
         DEFRAG_PROG="$XFS_FSR_PROG"
        ;;
     ext4|ext4dev)
-        DEFRAG_PROG="$E4DEFRAG_PROG"
+       DEFRAG_PROG="$E4DEFRAG_PROG"
+       dumpe2fs -h $SCRATCH_DEV 2> /dev/null | grep -wq extent || \
+            _notrun "file system does not have extents, needed for defrag"
        ;;
     btrfs)
        DEFRAG_PROG="$BTRFS_UTIL_PROG filesystem defragment"