From patchwork Thu Apr 26 05:53:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10364653 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 EB69A601BE for ; Thu, 26 Apr 2018 05:52:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAA262868D for ; Thu, 26 Apr 2018 05:52:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF8352900D; Thu, 26 Apr 2018 05:52: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=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, 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 4590C2868D for ; Thu, 26 Apr 2018 05:52:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752893AbeDZFwJ (ORCPT ); Thu, 26 Apr 2018 01:52:09 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:45630 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752876AbeDZFwI (ORCPT ); Thu, 26 Apr 2018 01:52:08 -0400 Received: by mail-io0-f196.google.com with SMTP id r22-v6so20566067ioc.12; Wed, 25 Apr 2018 22:52: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=z5NiLOhxvN90qYr207LRlwt9wgoMIbn0EC3tQxRgKMs=; b=UwA0mZmSnBwS7YHWoc96h1a1regLh8enoFZ/tVUKgUOfyTFnSXatxeOJTn5MHElWXe rKY92q4KYM1BDra0nUUHbBpZAWlIoYd9TY5173xIL3EaspwAWCEaNfp+WQaSLHcCohhu w+oXxn22U4AfM91Gvv8yRtYWQIT8eBh4FTRbhSG22lhYfaoY8nXyYUKfwXy0JqpLLjVi rqOn/1UvAJmgjyuPx/N3QJ9akZd1gm84ZDe8cO/U4k1yu73SlT7/NByuF+gn1C4i3k+M M2lfmi9tVUBOzSXhuYcRmo+zT68S26bhg5qs+3NIruulPrqH4YUoH1L6XKm4DeBomtmW Mw/w== 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=z5NiLOhxvN90qYr207LRlwt9wgoMIbn0EC3tQxRgKMs=; b=pCr8vL3KXWonHmdJFvMGOp3pVPiZaS28/FF90uut7qNEwEbcheIGuCcsDfcs3+BwDb CYqwdiojLtoU4Ocw93sPjM2e9HhgObngT+NDEPG/M82y1BlfLNN3bsJOP1JlGZbJdOpH epSeLyZND6M5pVy1aLgehfdsXmwQp0tB1MzWzmAoQ8wZK23YW1AkdSzbGrNANB4lh/Cn EaxK7b5o7luqC5Ep2dQXWxt3Ze8hO/0krqETkrsxyuZupBrUHJGIqXYaxQG42i2sBEmk Ta+DA5ymAfoajhrBAYJIQ6R77pwOHOvDqxCUELPqDyTWYqIxj80kLXPwF/WKjqGsB4wI Lxow== X-Gm-Message-State: ALQs6tB424bjID1xO0j/zCgZMxl88aeScCvQ79zgMjQ6bskNOTyOkE38 R8xwLCm5fXwy5x9BUp1C5eU= X-Google-Smtp-Source: AIpwx4/okbnTMvQtnOrRoAiw17Hw0VUPQjplzo9dhGfJjy9CvooBR6GMusjCZzU0EK5Z/svW+2NjQQ== X-Received: by 2002:a6b:ca43:: with SMTP id a64-v6mr33206525iog.15.1524721927862; Wed, 25 Apr 2018 22:52:07 -0700 (PDT) Received: from amir-VirtualBox.Home (174-23-139-12.slkc.qwest.net. [174.23.139.12]) by smtp.gmail.com with ESMTPSA id t9-v6sm2258493ioa.82.2018.04.25.22.52.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Apr 2018 22:52:07 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH v2 4/4] overlay/04{1,3,4}: enable xino feature Date: Wed, 25 Apr 2018 23:53:27 -0600 Message-Id: <1524722007-30891-5-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524722007-30891-1-git-send-email-amir73il@gmail.com> References: <1524722007-30891-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 These tests check for constant inode number on copy up with nonsamefs layer configuration. This problem is fixes only when opting-in with the xino=on mount option, so let the tests enable the mount option on new kernels and notrun on old kernels. Signed-off-by: Amir Goldstein --- tests/overlay/041 | 16 ++++++++++++---- tests/overlay/043 | 16 ++++++++++++---- tests/overlay/044 | 16 ++++++++++++---- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/tests/overlay/041 b/tests/overlay/041 index f3be746..78f8179 100755 --- a/tests/overlay/041 +++ b/tests/overlay/041 @@ -70,7 +70,15 @@ _scratch_mkfs upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER workdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK -_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir +# Enabling xino in this test requires that base filesystem inode numbers will +# not use bit 63 in inode number of the test files, because bit 63 is used by +# overlayfs to indicate the layer. Let's just assume that this is true for all +# tested filesystems and if we are wrong, the test may fail. +_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o xino=on || + _notrun "mount overlay with xino failed" +# Not using _check_scratch_fs_option because it uses grep -w +_fs_options $SCRATCH_DEV | grep -q "xino=on" || \ + _notrun "failed to enable xino" test_dir=$SCRATCH_MNT/test_dir/ @@ -171,7 +179,7 @@ subdir_d=$($here/src/t_dir_type $pure_lower_dir $pure_lower_subdir_st_ino) $UMOUNT_PROG $SCRATCH_MNT # check overlayfs -_overlay_check_scratch_dirs $lowerdir $upperdir $workdir +_overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o xino=on # Verify pure lower residing in dir which has another lower layer middir=$OVL_BASE_TEST_DIR/$seq-ovl-mid @@ -186,7 +194,7 @@ mkdir -p $lowerdir/test_dir/pure_lower_dir/subdir _scratch_mkfs -_overlay_scratch_mount_dirs $middir:$lowerdir $upperdir $workdir +_overlay_scratch_mount_dirs $middir:$lowerdir $upperdir $workdir -o xino=on # Copy up test_dir touch $test_dir/test_file @@ -209,7 +217,7 @@ subdir_d=$($here/src/t_dir_type $pure_lower_dir $pure_lower_subdir_st_ino) echo "Pure lower in dir which has another lower layer: Invalid d_ino reported for subdir" # check overlayfs -_overlay_check_scratch_dirs "$middir:$lowerdir" $upperdir $workdir +_overlay_check_scratch_dirs "$middir:$lowerdir" $upperdir $workdir -o xino=on echo "Silence is golden" status=0 diff --git a/tests/overlay/043 b/tests/overlay/043 index f70ee7f..c865b51 100755 --- a/tests/overlay/043 +++ b/tests/overlay/043 @@ -85,8 +85,16 @@ _scratch_mkfs >>$seqres.full 2>&1 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER workdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK -# Enable redirect_dir for renaming a merge directory -_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o redirect_dir=on +# Enable redirect_dir for renaming a merge directory. +# Enabling xino in this test requires that base filesystem inode numbers will +# not use bit 63 in inode number of the test files, because bit 63 is used by +# overlayfs to indicate the layer. Let's just assume that this is true for all +# tested filesystems and if we are wrong, the test may fail. +_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o redirect_dir=on,xino=on || \ + _notrun "mount overlay with xino failed" +# Not using _check_scratch_fs_option because it uses grep -w +_fs_options $SCRATCH_DEV | grep -q "xino=on" || \ + _notrun "failed to enable xino" FILES="dir file symlink chrdev blkdev fifo socket" @@ -153,13 +161,13 @@ check_inode_numbers $testdir $tmp.after_copyup $tmp.after_move # Verify that the inode numbers survive a mount cycle $UMOUNT_PROG $SCRATCH_MNT -_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o redirect_dir=on +_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o redirect_dir=on,xino=on # Compare inode numbers before/after mount cycle check_inode_numbers $testdir $tmp.after_move $tmp.after_cycle # check overlayfs -_overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o redirect_dir=on +_overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o redirect_dir=on,xino=on echo "Silence is golden" status=0 diff --git a/tests/overlay/044 b/tests/overlay/044 index 2ab3035..bcc30ac 100755 --- a/tests/overlay/044 +++ b/tests/overlay/044 @@ -99,8 +99,16 @@ _scratch_mkfs >>$seqres.full 2>&1 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER workdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK -# Enable overlay index feature to prevent breaking hardlinks on copy up -_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o index=on +# Enable overlay index feature to prevent breaking hardlinks on copy up. +# Enabling xino in this test requires that base filesystem inode numbers will +# not use bit 63 in inode number of the test files, because bit 63 is used by +# overlayfs to indicate the layer. Let's just assume that this is true for all +# tested filesystems and if we are wrong, the test may fail. +_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o index=on,xino=on || \ + _notrun "mount overlay with xino failed" +# Not using _check_scratch_fs_option because it uses grep -w +_fs_options $SCRATCH_DEV | grep -q "xino=on" || \ + _notrun "failed to enable xino" rm -f $tmp.* @@ -124,8 +132,8 @@ check_ino_nlink $SCRATCH_MNT $tmp.before $tmp.after_one # Verify that the hardlinks survive a mount cycle $UMOUNT_PROG $SCRATCH_MNT -_overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o index=on -_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o index=on +_overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o index=on,xino=on +_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o index=on,xino=on echo "== After mount cycle ==" cat $FILES