From: Murphy Zhou <jencce.kernel@gmail.com>
To: fstests@vger.kernel.org
Cc: zlang@redhat.com
Subject: [PATCH v2] generic/new: drop caches while freeze
Date: Fri, 15 Dec 2023 19:55:05 +0800 [thread overview]
Message-ID: <20231215115505.1826465-1-jencce.kernel@gmail.com> (raw)
In-Reply-To: <CADJHv_t4fzLjNBfabTSVgSW8QAjq7V=s_wW7cOJ8UPo+t9vdNw@mail.gmail.com>
Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
---
v2:
re-number to 738
mkfs and mount scratch in the begining
create more files and comment why
unfreeze in cleanup
tests/generic/738 | 54 +++++++++++++++++++++++++++++++++++++++++++
tests/generic/738.out | 2 ++
2 files changed, 56 insertions(+)
create mode 100755 tests/generic/738
create mode 100644 tests/generic/738.out
diff --git a/tests/generic/738 b/tests/generic/738
new file mode 100755
index 00000000..9f1f9d6b
--- /dev/null
+++ b/tests/generic/738
@@ -0,0 +1,54 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+#
+# FS QA Test 738
+#
+# Test possible deadlock of umount and reclaim memory
+# when there are EOF blocks in files.
+#
+. ./common/preamble
+_begin_fstest freeze auto quick
+
+_cleanup()
+{
+ xfs_freeze -u $SCRATCH_MNT
+ wait
+ cd /
+ rm -r -f $tmp.*
+}
+
+_supported_fs generic
+_require_scratch
+_require_freeze
+
+_scratch_mkfs >> $seqres.full
+_scratch_mount
+
+create_eof_block_file()
+{
+ # Create several EOF blocks in the new file
+ for j in $(seq 1 5); do
+ cat $SCRATCH_MNT/testfile >> $1
+ done
+}
+
+$XFS_IO_PROG -fc "pwrite 0 64k" $SCRATCH_MNT/testfile >> $seqres.full
+
+# Create enough files to make sure there is enough cache
+for i in $(seq 0 1024); do
+ create_eof_block_file $SCRATCH_MNT/$i
+done
+
+sync
+
+xfs_freeze -f $SCRATCH_MNT
+
+# This will hang if bug reproduces
+echo 3 > /proc/sys/vm/drop_caches &
+
+# Wait a while before exiting and unfreezing.
+sleep 3
+# success, all done
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/generic/738.out b/tests/generic/738.out
new file mode 100644
index 00000000..5719515a
--- /dev/null
+++ b/tests/generic/738.out
@@ -0,0 +1,2 @@
+QA output created by 738
+Silence is golden
--
2.31.1
next prev parent reply other threads:[~2023-12-15 11:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-13 9:20 [PATCH] generic/new: drop caches while freeze Murphy Zhou
2023-12-13 15:34 ` Zorro Lang
2023-12-15 6:21 ` Murphy Zhou
2023-12-15 11:55 ` Murphy Zhou [this message]
2023-12-15 17:31 ` [PATCH v2] " Zorro Lang
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=20231215115505.1826465-1-jencce.kernel@gmail.com \
--to=jencce.kernel@gmail.com \
--cc=fstests@vger.kernel.org \
--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.