From: Shiyang Ruan Date: Wed, 3 Aug 2022 04:51:30 +0000 (+0000) Subject: xfs: add memory failure test for dax&reflink mode X-Git-Tag: v2022.08.07~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=545d6b783773484dd0101b0bc60523a2a8c16251;p=xfstests-dev.git xfs: add memory failure test for dax&reflink mode Verify that the dax-rmap feature works. Signed-off-by: Shiyang Ruan Reviewed-by: Darrick J. Wong Signed-off-by: Zorro Lang --- diff --git a/tests/xfs/551 b/tests/xfs/551 new file mode 100755 index 00000000..f4af72ed --- /dev/null +++ b/tests/xfs/551 @@ -0,0 +1,51 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2022 Fujitsu Limited. All Rights Reserved. +# +# FS QA Test No. 551 +# +# 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 +exit diff --git a/tests/xfs/551.out b/tests/xfs/551.out new file mode 100644 index 00000000..6dc8533f --- /dev/null +++ b/tests/xfs/551.out @@ -0,0 +1,9 @@ +QA output created by 551 +Format and mount +Create the original files +Inject memory failure (1 page) +Inject poison... +Process is killed by signal: 7 +Inject memory failure (2 pages) +Inject poison... +Process is killed by signal: 7