From patchwork Tue Sep 19 11:39:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9958713 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 99457601E9 for ; Tue, 19 Sep 2017 11:39:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 909EA28E13 for ; Tue, 19 Sep 2017 11:39:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8587828E16; Tue, 19 Sep 2017 11:39: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 2FB4328E13 for ; Tue, 19 Sep 2017 11:39:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751451AbdISLjR (ORCPT ); Tue, 19 Sep 2017 07:39:17 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36302 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751109AbdISLjR (ORCPT ); Tue, 19 Sep 2017 07:39:17 -0400 Received: by mail-wm0-f68.google.com with SMTP id r136so3603188wmf.3; Tue, 19 Sep 2017 04:39:16 -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=VqBZWxpKwbrKwbBIoXIw/TniCrzI6DVDggqi7URQPHk=; b=qKR0nnjnP51UYpmffVC2af9Fqc6lC0HMh73lJoc/LPy9nwKO5F57lxXfNzjiZ39cvU rh+bmm/kB7Qqg9HCmsR5uMptPvs0r4//HjykHbZYMk8X7w5Nmiygn3wrT2+Hn5zCJRBA sAHILj9ZY6qHrpNsIWxtKZBhazIq3vTPivxKNG/LF/KbPOqT8FDTOb+qBNriIe8aIZb1 nFn59Y8WGysgu9hKIKkm5OxrdbwS587u7BVcYMk6a07lQL7tzQz9smjxb1/vdLtuzexv SbaXwOZ46WbsnS69CQ+EfpFZWF3+YgBmkg+jGYghUOrfRXNINfzjhTtjRZpfkRBP+eLx ZpNA== 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=VqBZWxpKwbrKwbBIoXIw/TniCrzI6DVDggqi7URQPHk=; b=W6dL2A0vlfn9lmW0VFg4SVr1BJt4nOEKMi5DL+aWhl7dn1vkwyFsAfsZBafZeiAUXu K39szSNFD8piWx/e9EOk0dUQ+G5fVWyCmldPrL5hPBCcGgmvQ/e9IICURaPGmRQPWsxu lj/HNN+UvCgX6mSfpwYe7UyAXr3GXzIkAd+8DMhQyaEgJY1KEbgZXYL5MDlLGsUBOBlO LEL6Day8EUrqmQFPLcYEpF0lHFADnSCcDw+pKWzMyFHmIab6A1FLYW7eJETE/XLuGSP8 f7DDLEYUrpgNHyVXlv1CWQHR3+ElWM4w3besrAp/gprWX6ZXeLeN8XfnMc2XPLOB/m0q 2Nvw== X-Gm-Message-State: AHPjjUg8oNC6AzTzLCJVV2Myi/8CxhYf/ghaMMYkuv19OLHEVHRdl1Y9 Khf8811/Z4WGCHQ7hqYr76w= X-Google-Smtp-Source: AOwi7QBeFkBqJvOODCgAeB6Etj3ML9k65WkS0dgtilxBkj9NFLjNXoCNE17sVYeBnCnsYapcGWZfsw== X-Received: by 10.28.88.201 with SMTP id m192mr785893wmb.111.1505821155712; Tue, 19 Sep 2017 04:39:15 -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 o59sm6659350wrc.45.2017.09.19.04.39.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Sep 2017 04:39:15 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org, zhangyi Subject: [PATCH 2/2] overlay/031: fix test with inodes index enabled Date: Tue, 19 Sep 2017 14:39:44 +0300 Message-Id: <1505821184-3913-3-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505821184-3913-1-git-send-email-amir73il@gmail.com> References: <1505821184-3913-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 overlayfs is configured with CONFIG_OVERLAY_FS_INDEX=y, workdir from previous overlay mount cannot be reused in a new overlay mount that uses a different upper dir. Fix the test to use a different workdir when mounting with a different upper dir. This change has no effect on older kernels and overlay configured without CONFIG_OVERLAY_FS_INDEX. Cc: zhangyi (F) Signed-off-by: Amir Goldstein --- tests/overlay/031 | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/overlay/031 b/tests/overlay/031 index 161022e..70ee299 100755 --- a/tests/overlay/031 +++ b/tests/overlay/031 @@ -43,12 +43,17 @@ _cleanup() # testfile to create a whiteout in upper dir. create_whiteout() { - mkdir -p $1/testdir - touch $1/testdir/$4 + local lower=$1 + local upper=$2 + local work=$3 + local file=$4 - _overlay_mount_dirs $1 $2 $3 $OVL_BASE_SCRATCH_MNT $SCRATCH_MNT + mkdir -p $lower/testdir + touch $lower/testdir/$file - rm -f $SCRATCH_MNT/testdir/$4 + _overlay_mount_dirs $lower $upper $work $OVL_BASE_SCRATCH_MNT $SCRATCH_MNT + + rm -f $SCRATCH_MNT/testdir/$file $UMOUNT_PROG $SCRATCH_MNT } @@ -72,9 +77,13 @@ lowerdir1=$OVL_BASE_SCRATCH_MNT/lower1 lowerdir2=$OVL_BASE_SCRATCH_MNT/lower2 upperdir=$OVL_BASE_SCRATCH_MNT/upper workdir=$OVL_BASE_SCRATCH_MNT/workdir +# When overlay inode index feature is enabled, a workdir cannot be reused +# with a different upperdir. workdir1 in this test is used as the workdir +# when lowerdir1 is used as the upperdir. +workdir1=$OVL_BASE_SCRATCH_MNT/workdir1 testfile1=a testfile2=b -mkdir -p $lowerdir1 $lowerdir2 $upperdir $workdir +mkdir -p $lowerdir1 $lowerdir2 $upperdir $workdir $workdir1 create_whiteout $lowerdir1 $upperdir $workdir $testfile1 @@ -108,7 +117,7 @@ $UMOUNT_PROG $SCRATCH_MNT rm -rf $lowerdir1/testdir rm -rf $upperdir/testdir -create_whiteout $lowerdir2 $lowerdir1 $workdir $testfile1 +create_whiteout $lowerdir2 $lowerdir1 $workdir1 $testfile1 rm -rf $lowerdir2/testdir @@ -128,7 +137,7 @@ create_whiteout $lowerdir1 $upperdir $workdir $testfile1 rm -rf $lowerdir1/testdir/$testfile1 -create_whiteout $lowerdir2 $lowerdir1 $workdir $testfile2 +create_whiteout $lowerdir2 $lowerdir1 $workdir1 $testfile2 _overlay_mount_dirs $lowerdir1 $upperdir $workdir $OVL_BASE_SCRATCH_MNT $SCRATCH_MNT