All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests/xfs: check avail blocks after log recovery on ro mount
@ 2021-08-06  1:49 Murphy Zhou
  2021-08-06 18:55 ` Darrick J. Wong
  0 siblings, 1 reply; 20+ messages in thread
From: Murphy Zhou @ 2021-08-06  1:49 UTC (permalink / raw)
  To: fstests; +Cc: ddouwsma

And followed by a rw mount.

Suggested-by:  Donald Douwsma <ddouwsma@redhat.com>
Signed-off-by: Murphy Zhou <xzhou@redhat.com>
---
 tests/xfs/175     | 59 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/175.out |  2 ++
 2 files changed, 61 insertions(+)
 create mode 100755 tests/xfs/175
 create mode 100644 tests/xfs/175.out

diff --git a/tests/xfs/175 b/tests/xfs/175
new file mode 100755
index 00000000..2a79a3d4
--- /dev/null
+++ b/tests/xfs/175
@@ -0,0 +1,59 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2021 RedHat All Rights Reserved.
+#
+# FS QA Test 175
+#
+# Testcase for kernel commit:
+#   50d25484bebe xfs: sync lazy sb accounting on quiesce of read-only mounts
+#
+# After shutdown and readonly mount, a following read-write mount would
+# get wrong number of available blocks.
+#
+. ./common/preamble
+_begin_fstest shutdown auto quick
+
+# real QA test starts here
+
+_supported_fs xfs
+_require_scratch
+
+_scratch_mkfs > $seqres.full 2>&1
+mount $SCRATCH_DEV $SCRATCH_MNT
+
+# Write test file
+ls > $SCRATCH_MNT/testfile
+df --output=avail $SCRATCH_MNT >> $seqres.full 2>&1
+
+# Shutdown
+$XFS_IO_PROG -x -c "shutdown -f" $SCRATCH_MNT
+
+# Mount ReadOnly
+_scratch_unmount
+_scratch_mount -oro
+df --output=avail $SCRATCH_MNT >> $seqres.full 2>&1
+# Umount and mount rw
+_scratch_unmount
+_scratch_mount
+
+# Get fdblocks before repair
+fdb1=$(df --output=avail $SCRATCH_MNT | tail -1)
+_scratch_unmount
+
+# Repair
+_repair_scratch_fs >> $seqres.full 2>&1
+
+# Re-mount
+_scratch_mount
+
+# Get fdblocks after repair
+fdb2=$(df --output=avail $SCRATCH_MNT | tail -1)
+
+echo fdb1 $fdb1 fdb2 $fdb2 >> $seqres.full 2>&1
+
+[ $fdb1 -ne $fdb2 ] && echo Wrong fdblocks: $fdb1 and $fdb2
+
+# success, all done
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/xfs/175.out b/tests/xfs/175.out
new file mode 100644
index 00000000..3b4af34b
--- /dev/null
+++ b/tests/xfs/175.out
@@ -0,0 +1,2 @@
+QA output created by 175
+Silence is golden
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-08-26  6:40 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06  1:49 [PATCH] tests/xfs: check avail blocks after log recovery on ro mount Murphy Zhou
2021-08-06 18:55 ` Darrick J. Wong
2021-08-23  7:05   ` [PATCH v2] tests/xfs: check available " Murphy Zhou
2021-08-23 17:43     ` Darrick J. Wong
2021-08-24  5:04       ` [PATCH v3] " Murphy Zhou
2021-08-24  5:42         ` Eryu Guan
2021-08-24  6:23         ` Zorro Lang
2021-08-24  9:06           ` [PATCH v4] tests/generic: check log recovery with readonly mount Murphy Zhou
2021-08-24 12:57             ` Zorro Lang
2021-08-24 23:22           ` [PATCH v3] tests/xfs: check available blocks after log recovery on ro mount Donald Douwsma
2021-08-25  1:06             ` Donald Douwsma
2021-08-25  3:26               ` [PATCH v5] tests/generic: check log recovery with readonly mount Murphy Zhou
2021-08-26  0:17                 ` Darrick J. Wong
2021-08-26  7:01                 ` Zorro Lang
2021-08-24 15:14         ` [PATCH v3] tests/xfs: check available blocks after log recovery on ro mount Darrick J. Wong
2021-08-24 16:53           ` Zorro Lang
2021-08-25 23:43             ` Darrick J. Wong
2021-08-26  0:00               ` Murphy Zhou
2021-08-26  0:15                 ` Darrick J. Wong
2021-08-26  6:59               ` Zorro Lang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.