From patchwork Wed Jul 12 09:43:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9836393 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 49CA5602BD for ; Wed, 12 Jul 2017 09:43:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B73528500 for ; Wed, 12 Jul 2017 09:43:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3041C28516; Wed, 12 Jul 2017 09:43:18 +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 262F728607 for ; Wed, 12 Jul 2017 09:43:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755821AbdGLJnQ (ORCPT ); Wed, 12 Jul 2017 05:43:16 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:34541 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750738AbdGLJnP (ORCPT ); Wed, 12 Jul 2017 05:43:15 -0400 Received: by mail-wr0-f195.google.com with SMTP id k67so4469958wrc.1; Wed, 12 Jul 2017 02:43:14 -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=+vFOqw+Nbo2vyzEvgvtxmPpHOqqV1WFzolb05nXa4Bs=; b=kDjmVEeYiFDVYWy6eOqL0UmL8HLPPpnDo2UvDVdqafxmCSmPR+pXLKYSBIo/4pfhNV 1woxZYNWAQ3ZdjmtyJ6qdvdA/0fnstcD/VnjQ/HfdxfRl2cfk7yJFWlOjEg3u82jBipQ oF9SfRbHH9YR4oef7YOOSEaO/IEhdqK0YaFjsEbcCivrxYJMuqe2423IB9oT/xUviPjA +jfsFT1G7xSqEv2K4Qj+vQkWknNiGbi4YkAjm7bMFyi5dvbzgUaDqhcQst7IJWHO6aOl u/qQhIUvZFMb8DgMDHv1yY59rUwwsz3CfKcmcpHPB8GbiUwCmVfxwZKPrTz9DuSEkEZ8 6FIw== 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=+vFOqw+Nbo2vyzEvgvtxmPpHOqqV1WFzolb05nXa4Bs=; b=GmGwEsFoQ3bFjGOlfT3VAKBnKl4I8/LzU0ZdtjjojFUJ6b8swMu8lM0NkOFnwH7wAh UJT1SgIp2wo7dg5j6/RQKeonHafMTVyKOp/kmCxu1o/1BlyeKuf/tQezBkZLxnyB62xZ wztw0kKCXmVLjCyNjyuOHVcqjq/NQYC/jEy3unMyjZtSkrbOHN5OOfbB6nyMEh6R7Az9 bScMQ65pv1RQJPRlS6PNMf49TpaEQTD8+3HWxbjjOl4kfPqNtrWUwL6GSYi6tRzdZKQV kdXvmBF2vdQbJcj9R1VwBUgKytOJMJ4cMMaFQadrbCWh1uvwwQQ7Z13Z65a20VpSI+Tm d5FQ== X-Gm-Message-State: AIVw11085xt2b3XJw9/v70SONFVSO2nJWvFUJ9MEgPJ+eV73u58r/2td OzrH5Tm+Ctj/BQ== X-Received: by 10.28.64.196 with SMTP id n187mr1893964wma.94.1499852593929; Wed, 12 Jul 2017 02:43:13 -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 i185sm1856256wmf.34.2017.07.12.02.43.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 02:43:13 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH 2/2] overlay: enable the index feature for overlay/hardlink tests Date: Wed, 12 Jul 2017 12:43:25 +0300 Message-Id: <1499852605-27759-3-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499852605-27759-1-git-send-email-amir73il@gmail.com> References: <1499852605-27759-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 Overlayfs hardlink test are expected to fail if overlayfs does not support the inodes index feature, so don't un them if kernel does not support the feature. If the feature is supported, enable it with the index=on mount option for the hardlink tests, regardless of the build time default determined by kernel config option CONFIG_OVERLAY_FS_INDEX. Signed-off-by: Amir Goldstein --- tests/overlay/018 | 8 +++++--- tests/overlay/032 | 4 +++- tests/overlay/033 | 8 +++++--- tests/overlay/034 | 9 ++++++--- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/tests/overlay/018 b/tests/overlay/018 index 41855dc..456f907 100755 --- a/tests/overlay/018 +++ b/tests/overlay/018 @@ -10,7 +10,7 @@ # #----------------------------------------------------------------------- # -# Copyright (C) 2016 CTERA Networks. All Rights Reserved. +# Copyright (C) 2016-2017 CTERA Networks. All Rights Reserved. # Author: Amir Goldstein # # This program is free software; you can redistribute it and/or @@ -49,6 +49,7 @@ _cleanup() _supported_fs overlay _supported_os Linux _require_scratch +_require_fs_feature index rm -f $seqres.full @@ -81,7 +82,8 @@ function check_ino_nlink() diff -u $before $after } -_scratch_mount +# Enable overlay index feature to prevent breaking hardlinks on copy up +_scratch_mount -o index=on rm -f $tmp.* @@ -105,7 +107,7 @@ cat $FILES check_ino_nlink $tmp.before $tmp.after_one # Verify that the hardlinks survive a mount cycle -_scratch_cycle_mount +_scratch_cycle_mount index=on echo "== After mount cycle ==" cat $FILES diff --git a/tests/overlay/032 b/tests/overlay/032 index d986ef2..b610bc2 100755 --- a/tests/overlay/032 +++ b/tests/overlay/032 @@ -53,6 +53,7 @@ rm -f $seqres.full _supported_fs overlay _supported_os Linux _require_scratch +_require_fs_feature index # Remove all files from previous tests _scratch_mkfs @@ -71,7 +72,8 @@ $XFS_IO_PROG -fc "pwrite 1g 4k" $lowerdir/zero >> $seqres.full ln $lowerdir/zero $lowerdir/one ln $lowerdir/zero $lowerdir/two -_scratch_mount +# Enable overlay index feature to prevent breaking hardlinks on copy up +_scratch_mount -o index=on do_cmd() { diff --git a/tests/overlay/033 b/tests/overlay/033 index 3c21624..2213a10 100755 --- a/tests/overlay/033 +++ b/tests/overlay/033 @@ -50,6 +50,7 @@ rm -f $seqres.full _supported_fs overlay _supported_os Linux _require_scratch +_require_fs_feature index report_nlink() { @@ -122,7 +123,7 @@ test_hardlinks() rm $SCRATCH_MNT/2 # Verify that orphan index is cleaned when dropping nlink to zero - ls $OVL_BASE_SCRATCH_MNT/$OVL_WORK/index 2>/dev/null + ls $OVL_BASE_SCRATCH_MNT/$OVL_WORK/index } # Remove all files from previous tests @@ -131,7 +132,8 @@ _scratch_mkfs # Create lower hardlinks create_hardlinks -_scratch_mount +# Enable overlay index feature to prevent breaking hardlinks on copy up +_scratch_mount -o index=on # Test hardlinks with warm dcache DCACHETEMP=warm test_hardlinks @@ -140,7 +142,7 @@ test_hardlinks _scratch_unmount _scratch_mkfs create_hardlinks -_scratch_mount +_scratch_mount -o index=on # Test hardlinks with cold dcache DCACHETEMP=cold diff --git a/tests/overlay/034 b/tests/overlay/034 index 2b4ca73..dba984b 100755 --- a/tests/overlay/034 +++ b/tests/overlay/034 @@ -64,6 +64,8 @@ rm -f $seqres.full _supported_fs overlay _supported_os Linux _require_scratch +# Without overlay index feature hardlinks are broken on copy up +_require_fs_feature index # Remove all files from previous tests _scratch_mkfs @@ -74,7 +76,8 @@ mkdir -p $lowerdir touch $lowerdir/0 ln $lowerdir/0 $lowerdir/1 -_scratch_mount +# Enable overlay index feature to prevent breaking hardlinks on copy up +_scratch_mount -o index=on # Copy up lower hardlink - overlay inode nlink 2 is copied from lower touch $SCRATCH_MNT/0 @@ -99,8 +102,8 @@ rm $SCRATCH_MNT/1 rm $SCRATCH_MNT/4 # Verify that orphan index is cleaned on mount -_scratch_cycle_mount -ls $OVL_BASE_SCRATCH_MNT/$OVL_WORK/index 2>/dev/null +_scratch_cycle_mount index=on +ls $OVL_BASE_SCRATCH_MNT/$OVL_WORK/index echo "Silence is golden" status=0