From patchwork Tue Sep 5 19:11:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9939551 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 4B0B460350 for ; Tue, 5 Sep 2017 19:11:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AF13289EB for ; Tue, 5 Sep 2017 19:11:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3002A289FF; Tue, 5 Sep 2017 19:11:26 +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 BFE94289EB for ; Tue, 5 Sep 2017 19:11:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751863AbdIETLX (ORCPT ); Tue, 5 Sep 2017 15:11:23 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37054 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752600AbdIETLJ (ORCPT ); Tue, 5 Sep 2017 15:11:09 -0400 Received: by mail-wm0-f66.google.com with SMTP id f4so1202874wmh.4; Tue, 05 Sep 2017 12:11:08 -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=XnN33OMduzrr25QCQHanRGpbG+LcDefb6QOLMpF0l9Q=; b=CcHfnXRnaESPjXSmO2S6mD7oeb+4yIAtGye9R0rd1N/G46u8vSCElS+tTNnyr/6kMp SDHvjcK1cd38MBT/sIOcz38aJXyiSlZhQtmiZYky1jobHPuuTNOEwGNuZMrKQu1LujLi rwiBhCDx4hNrKXcbFqTLRFk1ojTHfJ1JTgYvHxEmDuHI/fsLCE/gUycVtXDwQ2itMJzo NuXa6RagxlvfxTV2zdYIQUra7qVHBdxCiTcAq+ocB+hPbizjGeo6oUbRtqKUoDFP/csq /LBUnFoOYK+iS6wK6BcL9kHyltYsw+xxGG0GW8uCDIs8n/wmhUb4oQMCtYmCZUJG89Xl sV8g== 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=XnN33OMduzrr25QCQHanRGpbG+LcDefb6QOLMpF0l9Q=; b=qRpPhsvL05bPTSnd6J/6d5q1HeVD8PgjGqugtqb1BGxVL5v+krpWG9vI4jG2lsP5EB 9X393SJ495oxXN7/Y6OVbFK0yKIGvAf/tML4z7879EUnwbPUag/4vV7FdqqJLiYxwexs kaxEC5r77sELdmNSAEz2mWLInk7ZEttVdcyuMmruWvIgYOpZF6ao/NSZ57fdYGlOkA8S GYeR7tRtlvxsIcHu8K6PhENGJwjgo+ZhhamR2GwSdYaJtHcqg1P1unKnVoU6pB2AX5a5 K5dk6PGRUo0piE0p+e956UhuLWKoOqXcSJf2MEg2kcqyio7wPR3zczacrh+pwr3L9PcS 2+aw== X-Gm-Message-State: AHPjjUjcybUGXIJGy2O/cZEK7u8d984RimMxngclLqeE1Ry/j6DaWoqM dwI2CGCnCawRcGZl X-Google-Smtp-Source: ADKCNb4cdzBOyPYTBVzRn/wE3jggscyJ7+/IWnO3MblvaogjgyVR1fKT+MX3EPFooGF6gIBeitAdDw== X-Received: by 10.28.149.6 with SMTP id x6mr8748wmd.23.1504638668152; Tue, 05 Sep 2017 12:11:08 -0700 (PDT) Received: from localhost.localdomain (bzq-79-182-137-119.red.bezeqint.net. [79.182.137.119]) by smtp.gmail.com with ESMTPSA id 30sm1829015wry.34.2017.09.05.12.11.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Sep 2017 12:11:07 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Josef Bacik , fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v3 11/13] fstests: regression test for ext4 crash consistency bug Date: Tue, 5 Sep 2017 22:11:18 +0300 Message-Id: <1504638680-25682-12-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504638680-25682-1-git-send-email-amir73il@gmail.com> References: <1504638680-25682-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 This test is motivated by a bug found in ext4 during random crash consistency tests. This test uses device mapper flakey target to demonstrate the bug found using device mapper log-writes target. Signed-off-by: Amir Goldstein --- tests/generic/501 | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/501.out | 2 ++ tests/generic/group | 1 + 3 files changed, 83 insertions(+) create mode 100755 tests/generic/501 create mode 100644 tests/generic/501.out diff --git a/tests/generic/501 b/tests/generic/501 new file mode 100755 index 0000000..ccb513d --- /dev/null +++ b/tests/generic/501 @@ -0,0 +1,80 @@ +#! /bin/bash +# FS QA Test No. 501 +# +# This test is motivated by a bug found in ext4 during random crash +# consistency tests. +# +#----------------------------------------------------------------------- +# 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() +{ + _cleanup_flakey + cd / + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/dmflakey + +# real QA test starts here +_supported_fs generic +_supported_os Linux +_require_scratch +_require_dm_target flakey +_require_metadata_journaling $SCRATCH_DEV + +rm -f $seqres.full + +_scratch_mkfs >> $seqres.full 2>&1 + +_init_flakey +_mount_flakey + +fsxops=$tmp.fsxops +cat < $fsxops +write 0x137dd 0xdc69 0x0 +fallocate 0xb531 0xb5ad 0x21446 +collapse_range 0x1c000 0x4000 0x21446 +write 0x3e5ec 0x1a14 0x21446 +zero_range 0x20fac 0x6d9c 0x40000 keep_size +mapwrite 0x216ad 0x274f 0x40000 +EOF +run_check $here/ltp/fsx -d --replay-ops $fsxops $SCRATCH_MNT/testfile + +_flakey_drop_and_remount +_unmount_flakey +_cleanup_flakey +_check_scratch_fs + +echo "Silence is golden" + +status=0 +exit diff --git a/tests/generic/501.out b/tests/generic/501.out new file mode 100644 index 0000000..00133b6 --- /dev/null +++ b/tests/generic/501.out @@ -0,0 +1,2 @@ +QA output created by 501 +Silence is golden diff --git a/tests/generic/group b/tests/generic/group index c857153..1e1b524 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -458,3 +458,4 @@ 453 auto quick dir 454 auto quick attr 500 auto log replay +501 auto quick metadata