From patchwork Tue Feb 24 02:31:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 5869061 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AFCF2BF440 for ; Tue, 24 Feb 2015 02:32:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B0F7720630 for ; Tue, 24 Feb 2015 02:32:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8430D2062B for ; Tue, 24 Feb 2015 02:32:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752605AbbBXCcI (ORCPT ); Mon, 23 Feb 2015 21:32:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47110 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752601AbbBXCcH (ORCPT ); Mon, 23 Feb 2015 21:32:07 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1O2W1nF028492 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 23 Feb 2015 21:32:02 -0500 Received: from liberator.sandeen.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t1O2VxhP031031 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 23 Feb 2015 21:32:01 -0500 Message-ID: <54EBE29F.2010902@redhat.com> Date: Mon, 23 Feb 2015 20:31:59 -0600 From: Eric Sandeen MIME-Version: 1.0 To: Eric Sandeen , fstests@vger.kernel.org, Filipe Manana Subject: [PATCH V3] create _require_metadata_journaling, and add to tests that need it References: <54EBA093.3050401@redhat.com> <54EBAFE4.4080000@sandeen.net> In-Reply-To: <54EBAFE4.4080000@sandeen.net> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Many tests use dm_flakey to trigger log replay, but for filesystems that don't support metadata journaling, this causes failures when it shouldn't. (i.e. we can hardly test log replay if there is no log, and the subsequent filesystem check will turn up errors). For some tests they actually sync everything we care about, and find inconsistencies elsewhere, but I erred on the side of simply not running the test in most cases. Signed-off-by: Eric Sandeen Reviewed-by: Filipe Manana Tested-by: Filipe Manana --- V2: MOAR COLUMNS. Add default case. V3: whoops, dumpe2fs &>1 | grep -q so it doesn't break output when found -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/common/rc b/common/rc index 7449a1d..243cb93 100644 --- a/common/rc +++ b/common/rc @@ -2340,6 +2340,38 @@ _require_norecovery() _scratch_unmount } +# Does this filesystem support metadata journaling? +# We exclude ones here that don't; otherwise we assume that it does, so the +# test will run, fail, and motivate someone to update this test for a new +# filesystem. +# +# It's possible that TEST_DEV and SCRATCH_DEV have different features (it'd be +# odd, but possible) so check $TEST_DEV by default, but we can optionall pass +# any dev we want. +_require_metadata_journaling() +{ + if [ -z $1 ]; then + DEV=$TEST_DEV + else + DEV=$1 + fi + + case "$FSTYP" in + ext2|vfat|msdos) + _notrun "$FSTYP does not support metadata journaling" + ;; + ext4) + # ext4 could be mkfs'd without a journal... + _require_dumpe2fs + $DUMPE2FS_PROG -h $DEV 2>&1 | grep -q has_journal || \ + _notrun "$FSTYP on $DEV not configured with metadata journaling" + ;; + *) + # by default we pass; if you need to, add your fs above! + ;; + esac +} + # Does fiemap support? _require_fiemap() { diff --git a/tests/generic/034 b/tests/generic/034 index 4ec1db8..966b3d2 100755 --- a/tests/generic/034 +++ b/tests/generic/034 @@ -53,6 +53,7 @@ _supported_os Linux _need_to_be_root _require_scratch _require_dm_flakey +_require_metadata_journaling $SCRATCH_DEV rm -f $seqres.full diff --git a/tests/generic/040 b/tests/generic/040 index 5f10f48..c841fbc 100755 --- a/tests/generic/040 +++ b/tests/generic/040 @@ -62,6 +62,7 @@ _supported_os Linux _need_to_be_root _require_scratch _require_dm_flakey +_require_metadata_journaling $SCRATCH_DEV rm -f $seqres.full diff --git a/tests/generic/041 b/tests/generic/041 index 36a6f42..f38b662 100755 --- a/tests/generic/041 +++ b/tests/generic/041 @@ -66,6 +66,7 @@ _supported_os Linux _need_to_be_root _require_scratch _require_dm_flakey +_require_metadata_journaling $SCRATCH_DEV rm -f $seqres.full diff --git a/tests/generic/056 b/tests/generic/056 index 9ec00e3..8bb1522 100755 --- a/tests/generic/056 +++ b/tests/generic/056 @@ -55,6 +55,7 @@ _supported_os Linux _need_to_be_root _require_scratch _require_dm_flakey +_require_metadata_journaling $SCRATCH_DEV rm -f $seqres.full diff --git a/tests/generic/057 b/tests/generic/057 index 4c0ffd1..3b9f89e 100755 --- a/tests/generic/057 +++ b/tests/generic/057 @@ -55,6 +55,7 @@ _supported_os Linux _need_to_be_root _require_scratch _require_dm_flakey +_require_metadata_journaling $SCRATCH_DEV rm -f $seqres.full diff --git a/tests/generic/311 b/tests/generic/311 index 85e52e8..d21b6eb 100755 --- a/tests/generic/311 +++ b/tests/generic/311 @@ -56,6 +56,7 @@ _supported_os Linux _need_to_be_root _require_scratch_nocheck _require_dm_flakey +_require_metadata_journaling $SCRATCH_DEV # xfs_io is not required for this test, but it's the best way to verify # the test system supports fallocate() for allocation diff --git a/tests/generic/321 b/tests/generic/321 index 3bd6b12..c821a23 100755 --- a/tests/generic/321 +++ b/tests/generic/321 @@ -45,6 +45,7 @@ _supported_os Linux _need_to_be_root _require_scratch_nocheck _require_dm_flakey +_require_metadata_journaling $SCRATCH_DEV rm -f $seqres.full diff --git a/tests/generic/322 b/tests/generic/322 index 3ec2387..4c0edf6 100755 --- a/tests/generic/322 +++ b/tests/generic/322 @@ -45,6 +45,7 @@ _supported_os Linux _need_to_be_root _require_scratch_nocheck _require_dm_flakey +_require_metadata_journaling $SCRATCH_DEV rm -f $seqres.full