All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Eryu Guan <eguan@redhat.com>
Cc: Josef Bacik <jbacik@fb.com>,
	fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH v4 8/8] fstests: regression test for xfs leftover CoW extent error
Date: Thu,  7 Sep 2017 13:03:13 +0300	[thread overview]
Message-ID: <1504778593-12071-9-git-send-email-amir73il@gmail.com> (raw)
In-Reply-To: <1504778593-12071-1-git-send-email-amir73il@gmail.com>

The following error are reported after running this test:

*** xfs_check output ***
leftover CoW extent (0/2147483736) len 1
block 0/2147483736 out of range
blocks 0/2147483736..2147483736 claimed by block 0/6
leftover CoW extent (0/2147483738) len 2
blocks 0/2147483738..2147483739 out of range
blocks 0/2147483738..2147483739 claimed by block 0/6
leftover CoW extent (0/2147483741) len 3
blocks 0/2147483741..2147483743 out of range
blocks 0/2147483741..2147483743 claimed by block 0/6
block 0/88 type unknown not expected
block 0/90 type unknown not expected
block 0/91 type unknown not expected
block 0/93 type unknown not expected
block 0/94 type unknown not expected
block 0/95 type unknown not expected

*** xfs_repair -n output ***
Phase 1 - find and verify superblock...
Phase 2 - using internal log
        - zero log...
        - scan filesystem freespace and inode maps...
leftover CoW extent (0/88) len 1
leftover CoW extent (0/90) len 2
leftover CoW extent (0/93) len 3
        - found root inode chunk

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 tests/generic/503     | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/503.out |  2 ++
 tests/generic/group   |  1 +
 3 files changed, 77 insertions(+)
 create mode 100755 tests/generic/503
 create mode 100644 tests/generic/503.out

diff --git a/tests/generic/503 b/tests/generic/503
new file mode 100755
index 0000000..5662eb6
--- /dev/null
+++ b/tests/generic/503
@@ -0,0 +1,74 @@
+#! /bin/bash
+# FS QA Test No. 503
+#
+# Regression test for xfs leftover CoW extents after truncate
+# and umount
+#
+#-----------------------------------------------------------------------
+# Copyright (C) 2017 CTERA Networks. All Rights Reserved.
+# Author: Amir Goldstein <amir73il@gmail.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/reflink
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch_reflink
+_require_cp_reflink
+_require_xfs_io_command "fzero"
+_require_xfs_io_command "fcollapse"
+_require_xfs_io_command "finsert"
+_require_xfs_io_command "truncate"
+
+rm -f $seqres.full
+
+_scratch_mkfs >/dev/null 2>&1
+_scratch_mount
+
+$XFS_IO_PROG -f -c "pwrite 0 0x40000" \
+	$SCRATCH_MNT/foo > /dev/null 2>&1
+
+_cp_reflink $SCRATCH_MNT/foo $SCRATCH_MNT/bar
+
+$XFS_IO_PROG -f -c "fzero -k 0x169f 0x387c" \
+		-c "fcollapse 0x29000 0xd000" \
+		-c "finsert 0 0x8000" \
+		-c "truncate 0x8000" \
+	$SCRATCH_MNT/foo > /dev/null 2>&1
+
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/generic/503.out b/tests/generic/503.out
new file mode 100644
index 0000000..6c1400a
--- /dev/null
+++ b/tests/generic/503.out
@@ -0,0 +1,2 @@
+QA output created by 503
+Silence is golden
diff --git a/tests/generic/group b/tests/generic/group
index 4324775..7a9cd78 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -460,3 +460,4 @@
 500 auto log replay
 501 auto quick metadata
 502 auto log replay clone
+503 auto quick clone
-- 
2.7.4


      parent reply	other threads:[~2017-09-07 10:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07 10:03 [PATCH v4 0/8] Crash consistency xfstest using dm-log-writes Amir Goldstein
2017-09-07 10:03 ` [PATCH v4 1/8] log-writes: add replay-log program to replay dm-log-writes target Amir Goldstein
2017-09-09 10:22   ` Eryu Guan
2017-09-07 10:03 ` [PATCH v4 2/8] replay-log: add validations for corrupt log entries Amir Goldstein
2017-09-07 10:03 ` [PATCH v4 3/8] replay-log: add support for replaying ops in target device sector range Amir Goldstein
2017-09-07 10:03 ` [PATCH v4 4/8] fstests: add support for working with dm-log-writes target Amir Goldstein
2017-09-07 10:03 ` [PATCH v4 5/8] fstests: crash consistency fsx test using dm-log-writes Amir Goldstein
2017-09-07 10:03 ` [PATCH v4 6/8] fstests: regression test for ext4 crash consistency bug Amir Goldstein
2017-09-07 10:03 ` [PATCH v4 7/8] fstests: crash consistency fsx test for cloned files Amir Goldstein
2017-09-07 10:03 ` Amir Goldstein [this message]

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=1504778593-12071-9-git-send-email-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=jbacik@fb.com \
    --cc=linux-fsdevel@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.