Thread (11 messages) 11 messages, 3 authors, 2021-08-22

Re: [PATCH 2/2] generic: test shutdowns of a nested filesystem

From: "Darrick J. Wong" <djwong@kernel.org>
Date: 2021-08-22 17:23:24
Also in: fstests

On Sun, Aug 22, 2021 at 07:18:49PM +0800, Eryu Guan wrote:
On Tue, Aug 17, 2021 at 04:53:25PM -0700, Darrick J. Wong wrote:
quoted
From: Darrick J. Wong <djwong@kernel.org>

generic/475, but we're running fsstress on a disk image inside the
scratch filesystem

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/rc             |   20 +++++++
 tests/generic/725     |  136 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/725.out |    2 +
 3 files changed, 158 insertions(+)
 create mode 100755 tests/generic/725
 create mode 100644 tests/generic/725.out

diff --git a/common/rc b/common/rc
index 84757fc1..473bfb0a 100644
--- a/common/rc
+++ b/common/rc
@@ -631,6 +631,26 @@ _ext4_metadump()
 		$DUMP_COMPRESSOR -f "$dumpfile" &>> "$seqres.full"
 }
 
+# Capture the metadata of a filesystem in a dump file for offline analysis
+_metadump_dev() {
+	local device="$1"
+	local dumpfile="$2"
+	local compressopt="$3"
+
+	case "$FSTYP" in
+	ext*)
+		_ext4_metadump $device $dumpfile $compressopt
+		;;
+	xfs)
+		_xfs_metadump $dumpfile $device none $compressopt
+		;;
+	*)
+		echo "Don't know how to metadump $FSTYP"
This breaks tests on filesystems other than ext* and xfs. I think it's
OK if we only want to use it in failure path, but it's better to
describe the use case in comments.
Ok, I'll make a note of that in the comment.

"Capture the metadata of a filesystem in a dump file for offline
analysis.  Not all filesystems support this, so this function should
only be used to capture information about a previous test failure."
And Im' wondering if should honor DUMP_CORRUPT_FS, and only do the dump
when it's set.
Yes.  Will fix that in the next release.

--D
Thanks,
Eryu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help