From: Theodore Ts'o Date: Sun, 5 Feb 2017 06:53:35 +0000 (-0500) Subject: common/log: add ext4 support for log state probing X-Git-Tag: v2022.05.01~2182 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b4d4037eeb3b6cb726d9cbaef6e03df7be3fca78;p=xfstests-dev.git common/log: add ext4 support for log state probing This enables generic/052, generic/054, and generic/055 for ext4. Signed-off-by: Theodore Ts'o Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/common/log b/common/log index 82899c67..d1c19ff5 100644 --- a/common/log +++ b/common/log @@ -228,6 +228,14 @@ _scratch_f2fs_logstate() echo $? } +_scratch_ext4_logstate() +{ + $DUMPE2FS_PROG -h $SCRATCH_DEV 2> /dev/null | tee -a $seqres.full | \ + grep "^Filesystem features" | grep -q needs_recovery + test $? -ne 0 + echo $? +} + _scratch_dump_log() { case "$FSTYP" in @@ -237,6 +245,9 @@ _scratch_dump_log() f2fs) $DUMP_F2FS_PROG $SCRATCH_DEV ;; + ext4) + $DUMPE2FS_PROG -h $SCRATCH_DEV + ;; *) ;; esac @@ -251,6 +262,9 @@ _test_dump_log() f2fs) $DUMP_F2FS_PROG $TEST_DEV ;; + ext4) + $DUMPE2FS_PROG -h $TEST_DEV + ;; *) ;; esac @@ -265,6 +279,9 @@ _print_logstate() f2fs) dirty=$(_scratch_f2fs_logstate) ;; + ext4) + dirty=$(_scratch_ext4_logstate) + ;; *) ;; esac @@ -532,6 +549,11 @@ _require_logstate() _notrun "This test requires dump.f2fs utility." fi ;; + ext4) + if [ -z "$DUMPE2FS_PROG" ]; then + _notrun "This test requires dumpe2fs utility." + fi + ;; *) _notrun "$FSTYP does not support log state probing." ;; @@ -570,6 +592,22 @@ _f2fs_log_config() echo " test10 active_logs=6,background_gc=on,discard,inline_data,inline_dentry" } +_ext4_log_config() +{ + echo "# mkfs-opt mount-opt" + echo "# ------------------------------" + echo " /dev/null data=writeback" + echo " /dev/null data=ordered" + echo " /dev/null data=journal" + echo " /dev/null data=ordered,data_err=abort" + echo " /dev/null data=writeback,nojournal_checksum" + echo " /dev/null data=ordered,nojournal_checksum" + echo " /dev/null data=journal,nojournal_checksum" + echo " /dev/null data=ordered,data_err=abort,nojournal_checksum" + echo " /dev/null data=writeback,journal_checksum" + echo " /dev/null data=ordered,journal_checksum" +} + _get_log_configs() { case "$FSTYP" in @@ -579,6 +617,9 @@ _get_log_configs() f2fs) _f2fs_log_config ;; + ext4) + _ext4_log_config + ;; *) _notrun "$FSTYP does not support log configs." ;;