diff mbox

[3/4] defrag: require extents support for ext4 defrag

Message ID 1456115171-13191-4-git-send-email-tytso@mit.edu (mailing list archive)
State New, archived
Headers show

Commit Message

Theodore Ts'o Feb. 22, 2016, 4:26 a.m. UTC
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>
---
 common/defrag | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Christoph Hellwig Feb. 22, 2016, 7:37 a.m. UTC | #1
Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/common/defrag b/common/defrag
index 942593e..6fbf830 100644
--- a/common/defrag
+++ b/common/defrag
@@ -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"