From: "Darrick J. Wong" <djwong@kernel.org>
To: Eric Sandeen <sandeen@redhat.com>, Zorro Lang <zlang@redhat.com>
Cc: xfs <linux-xfs@vger.kernel.org>, fstests <fstests@vger.kernel.org>
Subject: [PATCH] xfs: test xfs_copy doesn't do cached read before libxfs_mount
Date: Tue, 24 May 2022 12:54:17 -0700 [thread overview]
Message-ID: <Yo036Y+er/WaT2IH@magnolia> (raw)
In-Reply-To: <Yo027/k+vAYsUt4U@magnolia>
From: Darrick J. Wong <djwong@kernel.org>
This is a regression test for an xfs_copy fix that ensures that it
doesn't perform a cached read of an XFS filesystem prior to initializing
libxfs, since the xfs_mount (and hence the buffer cache) isn't set up
yet.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
tests/xfs/844 | 37 +++++++++++++++++++++++++++++++++++++
tests/xfs/844.out | 3 +++
3 files changed, 40 insertions(+), 1 deletion(-)
create mode 100755 tests/xfs/844
create mode 100644 tests/xfs/844.out
diff --git a/tests/xfs/844 b/tests/xfs/844
new file mode 100755
index 00000000..720f45bb
--- /dev/null
+++ b/tests/xfs/844
@@ -0,0 +1,37 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2022 Oracle. All Rights Reserved.
+#
+# FS QA Test 844
+#
+# Regression test for xfsprogs commit:
+#
+# XXXXXXXX ("xfs_copy: don't use cached buffer reads until after libxfs_mount")
+#
+. ./common/preamble
+_begin_fstest auto copy
+
+_cleanup()
+{
+ cd /
+ rm -r -f $tmp.* $TEST_DIR/$seq.*
+}
+
+# Import common functions.
+# . ./common/filter
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs generic
+_require_xfs_copy
+_require_test
+
+truncate -s 100m $TEST_DIR/$seq.a
+truncate -s 100m $TEST_DIR/$seq.b
+
+$XFS_COPY_PROG $TEST_DIR/$seq.a $TEST_DIR/$seq.b
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/844.out b/tests/xfs/844.out
new file mode 100644
index 00000000..dbefde1c
--- /dev/null
+++ b/tests/xfs/844.out
@@ -0,0 +1,3 @@
+QA output created by 844
+bad magic number
+xfs_copy: couldn't read superblock, error=22
next prev parent reply other threads:[~2022-05-24 19:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-24 19:50 [PATCH] xfs_copy: don't use cached buffer reads until after libxfs_mount Darrick J. Wong
2022-05-24 19:54 ` Darrick J. Wong [this message]
2022-05-24 23:47 ` [PATCH] xfs: test xfs_copy doesn't do cached read before libxfs_mount Dave Chinner
2022-05-25 4:02 ` Zorro Lang
2022-05-27 6:20 ` [PATCH] xfs_copy: don't use cached buffer reads until after libxfs_mount Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yo036Y+er/WaT2IH@magnolia \
--to=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=zlang@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.