From patchwork Thu Sep 7 10:03:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9941993 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8A9AD602CC for ; Thu, 7 Sep 2017 10:03:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CD8C28600 for ; Thu, 7 Sep 2017 10:03:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91BAC2860A; Thu, 7 Sep 2017 10:03:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 451D028600 for ; Thu, 7 Sep 2017 10:03:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754632AbdIGKDD (ORCPT ); Thu, 7 Sep 2017 06:03:03 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35351 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754578AbdIGKC7 (ORCPT ); Thu, 7 Sep 2017 06:02:59 -0400 Received: by mail-wm0-f68.google.com with SMTP id e64so1031573wmi.2; Thu, 07 Sep 2017 03:02:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LMUKL01sTw9maVjs4Gfj4funR+QNHEA7s4qvdiR/Q/s=; b=EFEO9A8h1orCb5BeXLBeRYmbEuUeqfk2MNuhgUz5t2bwF71WbFsMCXtYemcKfJzRO3 LLMlgSVuQv+3AYvs01CkC8GpWAv6FmBySKf/Tizvrf0mb0M2zJH1bKyjVuuzJdg2XZIS ImNg9Imkgp9J5kYweb1Rc/PDXZr6BpzMvbUEtwxbCVZJaqwxYJCERe1OJCv4GwI3pfCe hM0FzvGlWe7OFeW4mPbIN3CDGOWB35LytGyeKSjlBbmX73e08plnB7mF2tRHJZuAr9jo yc5tSVVNufdnprAmiysw0ekT9gatAcEXPo7ReJdrITmyiZT1MrKp0c5l/dIYcQAGez3h 1/yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LMUKL01sTw9maVjs4Gfj4funR+QNHEA7s4qvdiR/Q/s=; b=HEFSfAk7yE8xYUXBULz3umGR2NUs8OI0gl3BDHYirDH1nrH0015wFFp1znvanbOCy4 KdUvI10dRLuOLAaw7bxkfbgvZdK1wgXqyT2jI0CccsTjNMpCG3+dVIqH1C0dhZ1ENnUq SFf/8zcx4Hjmhvbe1FvznPOGYZiXVRNLKMuEIMYNAE0/BBACTlsrV4TvVFaSJz2/P4Lq ylIbpsG5taGp6oltVvtdLO05gVX2/g27uafv5hSFbOdQyG3figd04aJhSz8lTke8ZRjb O+qcdANcoBWIs1kTBYtG/qKYr2geoCAf/EqmZaR5EzjR2+c1Nlugv0+QHmgOieHYWiO/ Kazw== X-Gm-Message-State: AHPjjUjzGF/RyhH2e/+eQ6q3m6MRG2yptql/zvSME4fDM/JN0HeoauXk p0Hvof3hDzCsyuWd X-Google-Smtp-Source: AOwi7QAz7ulrcF1OkmrizL4oityyidK3kyNhjziNORssOMiSepuQlBmz79+HO2o36KvCYBgBhwXt8A== X-Received: by 10.28.137.135 with SMTP id l129mr33276wmd.151.1504778577865; Thu, 07 Sep 2017 03:02:57 -0700 (PDT) Received: from localhost.localdomain (bzq-166-168-31-246.red.bezeqint.net. [31.168.166.246]) by smtp.gmail.com with ESMTPSA id z108sm2190403wrc.49.2017.09.07.03.02.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Sep 2017 03:02:57 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Josef Bacik , 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 Message-Id: <1504778593-12071-9-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504778593-12071-1-git-send-email-amir73il@gmail.com> References: <1504778593-12071-1-git-send-email-amir73il@gmail.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 +# +# 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