From patchwork Wed Apr 18 14:16:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10348213 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 24CD960216 for ; Wed, 18 Apr 2018 14:15:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16FE428675 for ; Wed, 18 Apr 2018 14:15:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B29C286A2; Wed, 18 Apr 2018 14:15:44 +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 862BA28675 for ; Wed, 18 Apr 2018 14:15:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753412AbeDROPn (ORCPT ); Wed, 18 Apr 2018 10:15:43 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:42841 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753788AbeDROPm (ORCPT ); Wed, 18 Apr 2018 10:15:42 -0400 Received: by mail-wr0-f195.google.com with SMTP id s18-v6so5291470wrg.9; Wed, 18 Apr 2018 07:15:41 -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=SYyjmdLIxrINUbDplKz5PQfBHysaR7w79nBqtk02n+A=; b=t6fNm9N6pMLhwweC9IUYt9iZnNY+u5hErc1tAg/r2oX3m0WOLltX0vdE8qIrZzvfPF EoOILKuZjWPP3cvUqCe6z77tExXt4oJTaiI6KsDJ9Ic0+kr6caaZDwKljqcPeSEwcMmM EYJAnolz/B0svhmBKIZsQC5y9TOgPJhnNBZDod8cPWafDLk32wiBChzbHchr7+intnPL umXECwsxRHf5shWxaRG7XLvQbJipMh+jywpskAdprtYIPv5AZclcgRNIpik61f1cH1Pr OsYToBputwaeHLDqclC1qv9cRMQix+wjSO7eRJdoWm/Bz3ypiym9QOrH9B8aq6hU2hfY 6Ptg== 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=SYyjmdLIxrINUbDplKz5PQfBHysaR7w79nBqtk02n+A=; b=YDeCBbCOCBdzoqgofwrZL5RWRVQDuv7hg02bqVhb2+Ij7haP6rCaGBPhpNUJMVno+8 W9Onkm5Jh1rbPtBAr0a3lxLrwQYA0b84IyeJeC+QNRr2bWZ3dYnIGdZzomSB9nNdChUu 48JVdEOkAzDc67Qehdr5uNzCNMw9J8yVP7wBJtCmatSlTYy/BEaGwrBRPLM01WBDl/8L LduY3Wvlu/HJdWvueIEYwRIKgiuLSATQ/CxN65oBpiWBmswiWUWBv41iYR81CJ/vDdAj K4YCQQ4C5Dn3bDoyxBX+936FbMDxhFrV8xnL+gV+BkW6zZLMPaUwFtvPnFkjfyBiSpPZ MpvA== X-Gm-Message-State: ALQs6tDCmpVxo3jYEJUCx82F/ic0k9bzo8ilIl5uGMgBf27x62vgXR4a onSkAFrRck16bcl6eVi8uzg= X-Google-Smtp-Source: AIpwx4/jNAi/2VixBDWiEHbBbsynvDDyxS9er04zBoJkM7r4KghTIYUYi0zkEbfDJxZJaQeX7pyxEA== X-Received: by 2002:adf:8628:: with SMTP id 37-v6mr1855868wrv.255.1524060940747; Wed, 18 Apr 2018 07:15:40 -0700 (PDT) Received: from localhost.localdomain ([141.226.11.133]) by smtp.gmail.com with ESMTPSA id t8sm1645462wmc.20.2018.04.18.07.15.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Apr 2018 07:15:40 -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/04{1,3,4}: enable xino feature Date: Wed, 18 Apr 2018 17:16:58 +0300 Message-Id: <1524061018-20413-3-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524061018-20413-1-git-send-email-amir73il@gmail.com> References: <1524061018-20413-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 | 15 +++++++++++---- tests/overlay/043 | 13 ++++++++++--- tests/overlay/044 | 15 +++++++++++---- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/tests/overlay/041 b/tests/overlay/041 index 4e72348..9de61f7 100755 --- a/tests/overlay/041 +++ b/tests/overlay/041 @@ -70,7 +70,14 @@ _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" +_check_scratch_fs_option "xino" || \ + _notrun "faild to enable xino" test_dir=$SCRATCH_MNT/test_dir/ @@ -171,7 +178,7 @@ subdir_d=$($here/src/t_dir_type $pure_lower_dir $pure_lower_subdir_st_ino) _scratch_unmount # 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 @@ -189,7 +196,7 @@ _scratch_mkfs upperdir=$OVL_BASE_SCRATCH_MNT/ovl-upper workdir=$OVL_BASE_SCRATCH_MNT/ovl-work -_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 @@ -212,7 +219,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 46df686..66771c0 100755 --- a/tests/overlay/043 +++ b/tests/overlay/043 @@ -83,7 +83,14 @@ _scratch_mkfs >>$seqres.full 2>&1 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" +_check_scratch_fs_option "xino" || \ + _notrun "faild to enable xino" FILES="dir file symlink chrdev blkdev fifo socket" @@ -150,13 +157,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 +_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o 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 +_overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o xino=on echo "Silence is golden" status=0 diff --git a/tests/overlay/044 b/tests/overlay/044 index 2ab3035..0e74128 100755 --- a/tests/overlay/044 +++ b/tests/overlay/044 @@ -99,8 +99,15 @@ _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" +_check_scratch_fs_option "xino" || \ + _notrun "faild to enable xino" rm -f $tmp.* @@ -124,8 +131,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