All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shiyang Ruan <ruansy.fnst@fujitsu.com>
To: <fstests@vger.kernel.org>
Cc: <ruansy.fnst@fujitsu.com>
Subject: [PATCH 2/3] xfs: add memory failure test for dax&reflink mode
Date: Fri, 13 May 2022 11:14:10 +0800	[thread overview]
Message-ID: <20220513031411.2369314-3-ruansy.fnst@fujitsu.com> (raw)
In-Reply-To: <20220513031411.2369314-1-ruansy.fnst@fujitsu.com>

Verify that the dax-rmap feature works.

Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
---
 tests/xfs/901     | 49 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/901.out |  9 +++++++++
 2 files changed, 58 insertions(+)
 create mode 100755 tests/xfs/901
 create mode 100644 tests/xfs/901.out

diff --git a/tests/xfs/901 b/tests/xfs/901
new file mode 100755
index 00000000..26c1581e
--- /dev/null
+++ b/tests/xfs/901
@@ -0,0 +1,49 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+#
+# FS QA Test No. 901
+#
+# Test memory failure mechanism when dax and reflink working together
+#
+. ./common/preamble
+_begin_fstest auto quick clone dax
+
+# Import common functions.
+. ./common/filter
+. ./common/reflink
+
+# real QA test starts here
+_require_check_dmesg
+_require_scratch_reflink
+_require_cp_reflink
+_require_xfs_scratch_rmapbt
+_require_scratch_dax_mountopt "dax"
+_require_test_program "t_mmap_cow_memory_failure"
+
+echo "Format and mount"
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount "-o dax" >> $seqres.full 2>&1
+
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
+
+echo "Create the original files"
+filesize=65536
+_pwrite_byte 0x61 0 $filesize $testdir/testfile >> $seqres.full
+_cp_reflink $testdir/testfile $testdir/poisonfile >> $seqres.full
+_scratch_cycle_mount "dax"
+
+echo "Inject memory failure (1 page)"
+# create two processes:
+#  process1: mread 1 page to cause page fault, and wait
+#  process2: mread 1 page to cause page fault, then inject poison on this page
+$here/src/t_mmap_cow_memory_failure -s1 -S1 -R $testdir/testfile -P $testdir/poisonfile
+
+echo "Inject memory failure (2 pages)"
+$here/src/t_mmap_cow_memory_failure -s2 -S2 -R $testdir/testfile -P $testdir/poisonfile
+
+_check_dmesg_for "Sending SIGBUS to t_mmap_cow_memo" || echo "Memory failure didn't kill the process"
+_check_dmesg_for "recovery action for dax page: Recovered" || echo "Failured page didn't recovered"
+
+# success, all done
+status=0
diff --git a/tests/xfs/901.out b/tests/xfs/901.out
new file mode 100644
index 00000000..92d64846
--- /dev/null
+++ b/tests/xfs/901.out
@@ -0,0 +1,9 @@
+QA output created by 901
+Format and mount
+Create the original files
+Inject memory failure (1 page)
+Inject posion...
+Process is killed by signal: 7
+Inject memory failure (2 pages)
+Inject posion...
+Process is killed by signal: 7
-- 
2.35.1




  parent reply	other threads:[~2022-05-13  3:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13  3:14 [PATCH v2 0/3] xfs: add memory failure tests for dax mode Shiyang Ruan
2022-05-13  3:14 ` [PATCH 1/3] xfs: add memory failure test " Shiyang Ruan
2022-05-18 18:38   ` Zorro Lang
2022-05-19  1:53     ` Shiyang Ruan
2022-05-19  4:56       ` Zorro Lang
2022-05-13  3:14 ` Shiyang Ruan [this message]
2022-05-13  3:18   ` [PATCH 2/3] xfs: add memory failure test for dax&reflink mode Shiyang Ruan
2022-05-13  3:14 ` [PATCH 3/3] xfs: add memory failure test for partly-reflinked&dax file Shiyang Ruan
  -- strict thread matches above, loose matches on Subject: below --
2022-03-11 15:18 [RFC PATCH 0/3] xfs: add memory failure tests for dax mode Shiyang Ruan
2022-03-11 15:18 ` [PATCH 2/3] xfs: add memory failure test for dax&reflink mode Shiyang Ruan
2022-04-27 18:07   ` Darrick J. Wong

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=20220513031411.2369314-3-ruansy.fnst@fujitsu.com \
    --to=ruansy.fnst@fujitsu.com \
    --cc=fstests@vger.kernel.org \
    /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.