Skip to contentSkip to conversation

generic/484: test data integrity for rdonly remount

PATCH Superseded Chengguang Xu 2 participants 3 messages Apr 22, 2020 – May 18, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/484: test data integrity for rdonly remount

This test checks data integrity when remounting from rw to ro mode.

---
 tests/generic/484     | 54 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/484.out |  2 ++
 tests/generic/group   |  1 +
 3 files changed, 57 insertions(+)
 create mode 100755 tests/generic/484
 create mode 100644 tests/generic/484.out
tests/generic/484 new file +54 -0
new file mode 100755
index 00000000..bc640214
@@ -0,0 +1,54 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2020 Chengguang Xu <[email protected]>.
+# All Rights Reserved.
+#
+# FS QA Test 484
+#
+# Test data integrity for ro remount.
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=0
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_fssum
+_require_scratch
+_require_scratch_shutdown
+
+_scratch_mkfs &>/dev/null
+_scratch_mount
+
+localdir=$SCRATCH_MNT/dir
+mkdir $localdir
+sync
+
+# fssum used for comparing checksum of test file(data & metedata),
+# exclude checking about atime, block structure, open error.
+$FSSUM_PROG -ugomAcdES -f -w $tmp.fssum $localdir
+_scratch_remount ro
+_scratch_shutdown
+_scratch_cycle_mount
+$FSSUM_PROG -r $tmp.fssum $localdir
+
+exit
tests/generic/484.out new file +2 -0
new file mode 100644
index 00000000..e33c7815
@@ -0,0 +1,2 @@
+QA output created by 484
+OK
tests/generic/group +1 -0
index 718575ba..cc58ff0d 100644
@@ -486,6 +486,7 @@
 481 auto quick log metadata
 482 auto metadata replay thin
 483 auto quick log metadata
+484 auto quick remount
 485 auto quick insert
 486 auto quick attr
 487 auto quick eio
Signature · 1 line
2.20.1
#1 lore raw
Quoted 4 lines · Chengguang Xu

This test checks data integrity when remounting from rw to ro mode.

The test itself looks fine. I'm just wondering that is there a real bug which is exposed by this test? And what's the purpose of the shutdown? More background info would be great if there's any.

Quoted 81 lines
---
 tests/generic/484     | 54 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/484.out |  2 ++
 tests/generic/group   |  1 +
 3 files changed, 57 insertions(+)
 create mode 100755 tests/generic/484
 create mode 100644 tests/generic/484.out
tests/generic/484 new file +54 -0
new file mode 100755
index 00000000..bc640214
@@ -0,0 +1,54 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2020 Chengguang Xu <[email protected]>.
+# All Rights Reserved.
+#
+# FS QA Test 484
+#
+# Test data integrity for ro remount.
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=0
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_fssum
+_require_scratch
+_require_scratch_shutdown
+
+_scratch_mkfs &>/dev/null
+_scratch_mount
+
+localdir=$SCRATCH_MNT/dir
+mkdir $localdir
+sync
+
+# fssum used for comparing checksum of test file(data & metedata),
+# exclude checking about atime, block structure, open error.
+$FSSUM_PROG -ugomAcdES -f -w $tmp.fssum $localdir
+_scratch_remount ro
+_scratch_shutdown
+_scratch_cycle_mount
+$FSSUM_PROG -r $tmp.fssum $localdir
+
+exit
tests/generic/484.out new file +2 -0
new file mode 100644
index 00000000..e33c7815
@@ -0,0 +1,2 @@
+QA output created by 484
+OK
tests/generic/group +0 -0
index 718575ba..cc58ff0d 100644

tests/generic/group line 489

Quoted 4 lines
tests/generic/group +1 -0
@@ -486,6 +486,7 @@
 481 auto quick log metadata
 482 auto metadata replay thin
 483 auto quick log metadata
+484 auto quick remount

Also in shutdown group.

Thanks,
Eryu

Quoted 6 lines
tests/generic/group +0 -0
 485 auto quick insert
 486 auto quick attr
 487 auto quick eio
Signature · 1 line
2.20.1
#2 lore raw

---- 在 星期日, 2020-05-17 22:29:22 Eryu Guan <[email protected]> 撰写 ----

Quoted 10 lines · Chengguang Xu
Quoted 4 lines

This test checks data integrity when remounting from rw to ro mode.

The test itself looks fine. I'm just wondering that is there a real bug which is exposed by this test? And what's the purpose of the shutdown? More background info would be great if there's any.

The case is for testing below fix patch in overlayfs but I think maybe it is also suitable for other file systems.
https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git/commit/?h=overlayfs-next&id=399c109d357a7e217cf7ef551e7e234439c68c15

shutdown will avoid effect of async dirty data flushing.

Quoted 79 lines
Quoted 79 lines
---
 tests/generic/484     | 54 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/484.out |  2 ++
 tests/generic/group   |  1 +
 3 files changed, 57 insertions(+)
 create mode 100755 tests/generic/484
 create mode 100644 tests/generic/484.out
tests/generic/484 new file +54 -0
new file mode 100755
index 00000000..bc640214
@@ -0,0 +1,54 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2020 Chengguang Xu <[email protected]>.
+# All Rights Reserved.
+#
+# FS QA Test 484
+#
+# Test data integrity for ro remount.
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$
+status=0
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_fssum
+_require_scratch
+_require_scratch_shutdown
+
+_scratch_mkfs &>/dev/null
+_scratch_mount
+
+localdir=$SCRATCH_MNT/dir
+mkdir $localdir
+sync
+
+# fssum used for comparing checksum of test file(data & metedata),
+# exclude checking about atime, block structure, open error.
+$FSSUM_PROG -ugomAcdES -f -w $tmp.fssum $localdir
+_scratch_remount ro
+_scratch_shutdown
+_scratch_cycle_mount
+$FSSUM_PROG -r $tmp.fssum $localdir
+
+exit
tests/generic/484.out new file +2 -0
new file mode 100644
index 00000000..e33c7815
@@ -0,0 +1,2 @@
+QA output created by 484
+OK
tests/generic/group +0 -1
index 718575ba..cc58ff0d 100644
--- a/tests/generic/group
Quoted 9 lines

tests/generic/group line 489

Quoted 6 lines

+++ b/tests/generic/group

tests/generic/group +1 -0
@@ -486,6 +486,7 @@
 481 auto quick log metadata
 482 auto metadata replay thin
 483 auto quick log metadata
+484 auto quick remount

Also in shutdown group.

I'll add this in next version.

Thanks,
cgxu