From patchwork Sun Sep 3 15:07:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9936415 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 0DEF66037D for ; Sun, 3 Sep 2017 15:07:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE67028655 for ; Sun, 3 Sep 2017 15:07:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0F6F286B0; Sun, 3 Sep 2017 15:07:28 +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 2F4C428655 for ; Sun, 3 Sep 2017 15:07:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752907AbdICPH0 (ORCPT ); Sun, 3 Sep 2017 11:07:26 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34546 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752878AbdICPH0 (ORCPT ); Sun, 3 Sep 2017 11:07:26 -0400 Received: by mail-wm0-f66.google.com with SMTP id l19so4305762wmi.1; Sun, 03 Sep 2017 08:07:25 -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; bh=XZjStRDN65Y1OiYe7/g+V9uwNwtbsBzgjLlfcUrmkuQ=; b=rvoD31qQCwVrVLAExU2q8LJilzI69H11jBEbqE4A0S2GhIcHlaNed5jFdUbp6/BdMp gYsJAQcI48h0pRpKSVLZxYIehpyspZEmqBEUaylDUXnuzXax7MGTI8Vrnywwhks0eFP1 R9lEapOblfwcNYpozbVYW9r5S+sTWKPTOMKYQPuA+VEf08SeKmrwVyAFCHXfzoswUXJM ZH45unfaWKD9yC1Q+l9ut19tgUt1q4X6nSL2fE+63EdfXfq42UUIjCvhDlqzAtgfEDis jKA9ebyVh9kQKogT87Kqvf4ei3jdwMCkXHdLxi3i9X1cH5/UKSoazESxon1PCXlQ6eYK yKRA== 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; bh=XZjStRDN65Y1OiYe7/g+V9uwNwtbsBzgjLlfcUrmkuQ=; b=XfSeQYxokVLsitEgsh5Oo+c8DDUDSblpWjYO2PRQD4Kqq3G/0s5qbzY9Xcbcz3v54Z hL7xi35mn9xHkzLcbiH+U0yo0cJgEj21RANmpzbVppsjPR6JNY3T57sSMcb8qafmBqkw 2uu7H7EVSpH/E3xrE5q19IT0lD+w4ZHZBJEi8pg7Jsa2sb7Jduq2AeRIGIGuBJlxGwxJ KZ2Jic3wfj4s3ODilCk5o21VoBAccWCmcTJLCRxUyRshUGpSvIQed0Rbdg3Z1t+TdSxO SuwGLIk3vpXRWZ3aSnZG1BuBMAi1hf5z1dk/OV+1LGIG9K7fge2B/a4lFqL8iCdHlzAH T7Pw== X-Gm-Message-State: AHPjjUhjbqbquDYhEp9026WC4S9lBjrLB2tTOg8DYQjvtaCgPb/Ke9ci PTA9kGbHAL9lUQ== X-Google-Smtp-Source: ADKCNb4QTBRZdK8Yq3qAYyqwxBzZ8oDsQUC+0nKSpCPoI7oG6a4kr+/WMeYBIyOG9xNDp6qHSYZHOg== X-Received: by 10.28.46.2 with SMTP id u2mr2342043wmu.182.1504451244475; Sun, 03 Sep 2017 08:07:24 -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 u35sm1151558wrf.64.2017.09.03.08.07.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 03 Sep 2017 08:07:23 -0700 (PDT) From: Amir Goldstein To: Christoph Hellwig Cc: Eryu Guan , "Darrick J . Wong" , fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [RFC][PATCH] fstests: regression test for xfs leftover CoW extent error Date: Sun, 3 Sep 2017 18:07:51 +0300 Message-Id: <1504451271-29202-1-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 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 the 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 --- Christoph, I started playing with crash tests for xfs reflink and created a variant of the crash test which clones files and runs fsx on the clones. I quickly stumbled on an fsck error that is reproduced without any crash at all. The sequence of operations (zero,collapse,insert,truncate) was recorded by fsx, I only bisected the minimal sequence to reproduce the error. When you understand what went on, it would be better to provide less arbitrary values of offset;length and add commentary to this test before merging it. Amir. tests/generic/503 | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/503.out | 2 ++ tests/generic/group | 1 + 3 files changed, 72 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..ebda756 --- /dev/null +++ b/tests/generic/503 @@ -0,0 +1,69 @@ +#! /bin/bash +# FS QA Test No. 503 +# +# Regression test for xfs leftover CoW extents error +# +#----------------------------------------------------------------------- +# 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 + +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