]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
ext4: regression test for "tune2fs -l" after ext4 shutdown
authorBoyang Xue <bxue@redhat.com>
Thu, 19 Aug 2021 08:07:51 +0000 (16:07 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 22 Aug 2021 10:35:53 +0000 (18:35 +0800)
Regression test for e2fsprogs commit:

e905fbe3fd0f ext4: Fix tune2fs checksum failure for mounted filesystem

This test runs "tune2fs -l" after ext4 shutdown. tune2fs reads
superblock checksum from the buffer cache. On unfixed kernels, the
checksum is incorrect until the writeout happens, so tune2fs fails
with "superblock checksum does not match" in this case.

Signed-off-by: Boyang Xue <bxue@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/ext4/051 [new file with mode: 0755]
tests/ext4/051.out [new file with mode: 0644]

diff --git a/tests/ext4/051 b/tests/ext4/051
new file mode 100755 (executable)
index 0000000..b4f56b0
--- /dev/null
@@ -0,0 +1,29 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2021 Red Hat Inc.  All Rights Reserved.
+#
+# FS QA Test No. 051
+#
+# Test that tune2fs doesn't fail after ext4 shutdown
+# Regression test for commit:
+# e905fbe3fd0f ext4: Fix tune2fs checksum failure for mounted filesystem
+#
+. ./common/preamble
+_begin_fstest auto rw quick
+
+# real QA test starts here
+_supported_fs ext4
+_require_scratch
+_require_scratch_shutdown
+_require_command "$TUNE2FS_PROG" tune2fs
+
+echo "Silence is golden"
+
+_scratch_mkfs >/dev/null 2>&1
+_scratch_mount
+echo "This is a test" > $SCRATCH_MNT/testfile
+_scratch_shutdown
+_scratch_cycle_mount
+$TUNE2FS_PROG -l $SCRATCH_DEV >> $seqres.full
+status=0
+exit
diff --git a/tests/ext4/051.out b/tests/ext4/051.out
new file mode 100644 (file)
index 0000000..32f74d8
--- /dev/null
@@ -0,0 +1,2 @@
+QA output created by 051
+Silence is golden