From patchwork Thu Feb 16 19:57:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9578291 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 9D00360244 for ; Thu, 16 Feb 2017 19:57:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 913672866A for ; Thu, 16 Feb 2017 19:57:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85EBA2866E; Thu, 16 Feb 2017 19:57:35 +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 27F402866B for ; Thu, 16 Feb 2017 19:57:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933083AbdBPT5e (ORCPT ); Thu, 16 Feb 2017 14:57:34 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35916 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932344AbdBPT5d (ORCPT ); Thu, 16 Feb 2017 14:57:33 -0500 Received: by mail-wm0-f68.google.com with SMTP id r18so4724413wmd.3; Thu, 16 Feb 2017 11:57:32 -0800 (PST) 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=j6rr9mq/bfcJOL+VnT/XqmATeV308V1N/81F+wzy3Vc=; b=O8v+FZNOd3oyEkfM6wlOGkYo8LTjjfaomVjkVt3Zhec50afVfc1QcCudmpOlupvOSg xyjdmad8/E4CyhUH2acnHvboRYVP6tLn+u4KPZ9+fXbQGt8SUa4BwijUhHO/PZns5IqU VDaHTfDGO1hpO+rPw6zmmBb8HJHHbkTKASCp5x+u5JUDx9VzUBKg0lsKEdGO4/K2KYpE Tj5e252MMn+ve+zqair+4ak89SaFQaMgOJ4bKIHUD12imog/uwhXZdQg74/n44uM2YKe gRDU/8uzd/DqV83lvcn56Dv+t0K7k8QiU8OmBTq29ejN2kZKZ2BzWNMM/oxfCcf6Pqts HxeA== 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=j6rr9mq/bfcJOL+VnT/XqmATeV308V1N/81F+wzy3Vc=; b=B1T1aiJuK0DNWCb9PhBesd1k8j2YVh+cDeNe3XaiAma88uQ961N20W3z4Bm0CCU3zU tJKZtevYQYJgDW5GnqR+AGlqgmkze+bD5HD9R8J75frNETk5uBn1awpypPey+XuQBaRa gdZyzapRp1bVcvr5L6RR/tDaG+nywlvlL+sbD3fpDnkT45nLvI50JabuXihqSo3UNhb+ r0W7eaOeGBDYdXPYcs/gsLpXu+/I9R+gTnt428/4krPHD0HLJEYhUcYm0LmazAe921yi aksAWoH7lqtlWZmGKoM+gCGgUgjzOLUJf3tvbn28vQ1NnDkoi7JHAf10czUPWnm5meVk 90YA== X-Gm-Message-State: AMke39lL17+KVXw6jAkDeOk3+/auqpzCbNLqnaZh8F/V+7Dt/8xe9V9dCLW7+jZNOo4bGw== X-Received: by 10.28.143.5 with SMTP id r5mr14160164wmd.141.1487275051685; Thu, 16 Feb 2017 11:57:31 -0800 (PST) Received: from localhost.localdomain (bzq-79-176-143-83.red.bezeqint.net. [79.176.143.83]) by smtp.gmail.com with ESMTPSA id c9sm1437210wmf.18.2017.02.16.11.57.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Feb 2017 11:57:31 -0800 (PST) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH v4 08/10] overlay: fix test and scratch filters for overlay base fs Date: Thu, 16 Feb 2017 21:57:06 +0200 Message-Id: <1487275028-29885-9-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487275028-29885-1-git-send-email-amir73il@gmail.com> References: <1487275028-29885-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 When configuring overlay base fs, TEST_DEV/DIR and SCRATCH_DEV/MNT are derived from the base fs mount points, where *_DEV are the path of the base fs mount point and TEST_DIR/SCRATCH_MNT are a directory under the base fs mount point. This means that the overlay DEV paths are prefixes of the overlay mount points. Fix the test and sctach filters to check if TEST_DEV/SCRATCH_DEV is a substring of TEST_DIR/SCRATCH_MNT and try and match the longer string first. Signed-off-by: Amir Goldstein --- common/filter | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/common/filter b/common/filter index 4328159..010f080 100644 --- a/common/filter +++ b/common/filter @@ -280,14 +280,32 @@ _filter_xfs_io_pages_modified() _filter_test_dir() { - sed -e "s,$TEST_DEV,TEST_DEV,g" -e "s,$TEST_DIR,TEST_DIR,g" + if ( echo $TEST_DIR | grep -q $TEST_DEV ); then + # TEST_DEV is substr of TEST_DIR (e.g. /mnt and /mnt/ovl-mnt) + # substitute TEST_DIR first + sed -e "s,$TEST_DIR,TEST_DIR,g" \ + -e "s,$TEST_DEV,TEST_DEV,g" + else + # TEST_DIR maybe a substr of TEST_DIR (e.g. /vdc and /dev/vdc) + # substitute TEST_DEV first + sed -e "s,$TEST_DEV,TEST_DEV,g" \ + -e "s,$TEST_DIR,TEST_DIR,g" + fi } _filter_scratch() { - sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" \ - -e "s,$SCRATCH_MNT,SCRATCH_MNT,g" \ - -e "/.use_space/d" + if ( echo $SCRATCH_MNT | grep -q $SCRATCH_DEV ); then + # SCRATCH_DEV is substr of SCRATCH_MNT + sed -e "s,$SCRATCH_MNT,SCRATCH_MNT,g" \ + -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" \ + -e "/.use_space/d" + else + # SCRATCH_MNT maybe a substr of SCRATCH_DEV + sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" \ + -e "s,$SCRATCH_MNT,SCRATCH_MNT,g" \ + -e "/.use_space/d" + fi } # Turn any device in the scratch pool into SCRATCH_DEV