From patchwork Wed Aug 30 02:44:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Misono Tomohiro X-Patchwork-Id: 9928659 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 C0D7760383 for ; Wed, 30 Aug 2017 02:45:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACD292026B for ; Wed, 30 Aug 2017 02:45:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A14C5205AF; Wed, 30 Aug 2017 02:45:10 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 0290C2026B for ; Wed, 30 Aug 2017 02:45:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751983AbdH3CpF (ORCPT ); Tue, 29 Aug 2017 22:45:05 -0400 Received: from mgwkm01.jp.fujitsu.com ([202.219.69.168]:16041 "EHLO mgwkm01.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751861AbdH3CpF (ORCPT ); Tue, 29 Aug 2017 22:45:05 -0400 Received: from kw-mxoi1.gw.nic.fujitsu.com (unknown [192.168.231.131]) by mgwkm01.jp.fujitsu.com with smtp id 7d10_7ab2_5d9b0323_1536_4a55_8e7b_96880611a53b; Wed, 30 Aug 2017 11:44:59 +0900 Received: from g01jpfmpwkw01.exch.g01.fujitsu.local (g01jpfmpwkw01.exch.g01.fujitsu.local [10.0.193.38]) by kw-mxoi1.gw.nic.fujitsu.com (Postfix) with ESMTP id B3F0FAC0123; Wed, 30 Aug 2017 11:44:55 +0900 (JST) Received: from g01jpexchkw33.g01.fujitsu.local (unknown [10.0.193.4]) by g01jpfmpwkw01.exch.g01.fujitsu.local (Postfix) with ESMTP id 0CCC2692680; Wed, 30 Aug 2017 11:44:55 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v2.5.2 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20170217-enc X-SHieldMailCheckerMailID: 18080a33af054424bf43e129cb985010 From: "Misono, Tomohiro" Subject: [PATCH] btrfs/029: fix wrong usage of name filter To: CC: Message-ID: Date: Wed, 30 Aug 2017 11:44:49 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Language: en-US X-SecurityPolicyCheck-GC: OK by FENCE-Mail X-TM-AS-MML: disable Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP btrfs/029 uses _filter_testdirs() to filter the name of $TEST_DIR and $SCRATCH_MNT directory. In this function, it calls both _filter_test_dir and _filter_scratch concatenated by pipe. Therefore if $TEST_DIR is a prefix of $SCRATCH_MNT, this filter function gives wrong filtered name for $SCRATCH_MNT and the test fails. Fix this by calling _filter_test_dir and _filter_scratch directly. Signed-off-by: Tomohiro Misono --- tests/btrfs/029 | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) rm -rf $2 @@ -86,7 +81,7 @@ _create_reflinks() cp --reflink=always $1 $2 >> $seqres.full 2>&1 || echo "cp reflink failed" # The failed target actually gets created by cp: - ls $2 | _filter_testdirs + ls $2 | _filter_test_dir } echo "test reflinks across different devices" diff --git a/tests/btrfs/029 b/tests/btrfs/029 index c390c95..74fded7 100755 --- a/tests/btrfs/029 +++ b/tests/btrfs/029 @@ -66,19 +66,14 @@ _scratch_mkfs > /dev/null 2>&1 _scratch_mount $XFS_IO_PROG -f -c 'pwrite -S 0x61 0 9000' $SCRATCH_MNT/original >> $seqres.full -_filter_testdirs() -{ - _filter_test_dir | _filter_scratch -} - _create_reflinks() { # auto reflink, should fall back to non-reflink rm -rf $2 echo "reflink=auto:" cp --reflink=auto $1 $2 - md5sum $1 | _filter_testdirs - md5sum $2 | _filter_testdirs + md5sum $1 | _filter_scratch + md5sum $2 | _filter_test_dir # always reflink, should fail outright