From patchwork Thu Oct 12 06:33:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10001111 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 257A36028A for ; Thu, 12 Oct 2017 06:32:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1006828CC3 for ; Thu, 12 Oct 2017 06:32:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03A4828CE5; Thu, 12 Oct 2017 06:32:51 +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 9203128CC3 for ; Thu, 12 Oct 2017 06:32:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751350AbdJLGct (ORCPT ); Thu, 12 Oct 2017 02:32:49 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33617 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750750AbdJLGct (ORCPT ); Thu, 12 Oct 2017 02:32:49 -0400 Received: by mail-wm0-f68.google.com with SMTP id u138so3392457wmu.0; Wed, 11 Oct 2017 23:32:48 -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; bh=e+jXS4g+jlRiOEneMcTnZaR/eyqvDz2xrBDtY1S6jWY=; b=UnnRBT64UrOOrsnOHs6So+mlymwG/xXfG9bNInbfSEEX19XKP480e8rm7703Zf3bQh hpthW4EKXv8/u6W916Xf4AUevZBPsQhsoo5ELyaeLRDkapDwrly6Q9RjcI70VN1YImtP KfUy5hv7zIj1fjF4z2VCo0rL9D5yYIQh7D6pNt+fDes5+b1YrpXlO/Jae69SuAeamhm0 GRHa9LCQMsIyEN/yPmS7qkY1YtpyxTl0Smf9iYMJbxPGY0jxR37zwUCzLXFiU6RMZkBF Xy+HRiq8JcR3zSQ+sQkKnEvHQeIi8KAbup/JYTsqe6q3yviTmd4lBm/S1bHVSfWpLGFu eaCA== 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; bh=e+jXS4g+jlRiOEneMcTnZaR/eyqvDz2xrBDtY1S6jWY=; b=YvDeLsPTKjp7/dbrhbQJRReinRQixEoASG6rOPkPRWA1cZsbNJI/WIgr/dexZVM4uC NUmA6otHTiXZBdlD0+ior6fl+tbJWUTzWQSqXknAKQNmd99ecj39vxnGeG1Wzp+KrEyk u0Sh26FylxVqrVvb4Tji6qlzVL1pc1L+ApSbDO7VXzuh4vXol2jz0nXGaHZdvZOJz/wA XbfMPyqehk8PO2DGaLMQWQ80z1LD5JrZau+gooeOwI0ITJoxIULPxn+HOXljnx6jpOk8 TW8UzBvO0Xo5526GtoJxhS0KGFNhxk4zY8Bn5E/4TShVLs/vG1CEFKt7vL6lRC/D6wDv f+Rg== X-Gm-Message-State: AMCzsaU9rcy4Vgwg6IS8GSHsQ/wmAsCCfNiKKDO4lcXC60UCHAPzjY2F 8USQYRbE1WDtrsKkbf71MCf8Pw== X-Google-Smtp-Source: AOwi7QD7DcscsZvLc1RmjGX6nCSoBCHpN1Eho2SbiETOcoYxdAPA4nFhFgnIGmFgJO3zOEsq8cz83A== X-Received: by 10.223.135.143 with SMTP id b15mr1256633wrb.24.1507789967735; Wed, 11 Oct 2017 23:32:47 -0700 (PDT) Received: from localhost.localdomain ([31.210.182.123]) by smtp.gmail.com with ESMTPSA id 9sm14025871wml.24.2017.10.11.23.32.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Oct 2017 23:32:47 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH] overlay/036: expect EBUSY for dir inuse only when mounting with index=on Date: Thu, 12 Oct 2017 09:33:29 +0300 Message-Id: <1507790009-9171-1-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This fixes test failure with kernel v4.14-rc4 and default index=off configuration. Signed-off-by: Amir Goldstein --- tests/overlay/036 | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/tests/overlay/036 b/tests/overlay/036 index d44efc1..544d4e4 100755 --- a/tests/overlay/036 +++ b/tests/overlay/036 @@ -11,7 +11,14 @@ # are currently in-use by another overlayfs mount on the system and bad # things can happen with such configuration. # -# Expect EBUSY when trying to mount overlay when: +# Commit 2cac0c00a6cd ("ovl: get exclusive ownership on upper/work dirs") +# in kernel v4.13 enforces upper/work dir in-use for any overlayfs mount. +# Later stable fix commit 85fdee1eef1a ("ovl: fix regression caused by +# exclusive upper/work dir protection") relaxes mount failure to a warning +# for index=off mount and fails mount with EBUSY for index=on mount. +# +# This test expects success with index=off and EBUSY with index=on +# when trying to mount overlay with: # - Upper dir is in-use by another overlay mount # - Work dir is in-use by another overlay mount # @@ -63,6 +70,7 @@ rm -f $seqres.full _supported_fs overlay _supported_os Linux _require_scratch +_require_scratch_feature index # Remove all files from previous tests _scratch_mkfs @@ -78,13 +86,30 @@ mkdir -p $lowerdir $lowerdir2 $upperdir $upperdir2 $workdir $workdir2 # Mount overlay with lowerdir, upperdir, workdir _overlay_mount_dirs $lowerdir $upperdir $workdir \ - overlay1 $SCRATCH_MNT -# Try to mount another overlay with the same upperdir - expect EBUSY + overlay $SCRATCH_MNT + +# Try to mount another overlay with the same upperdir +# with index=off - expect success +_overlay_mount_dirs $lowerdir2 $upperdir $workdir2 \ + overlay0 $SCRATCH_MNT -oindex=off && \ + $UMOUNT_PROG $SCRATCH_MNT + +# Try to mount another overlay with the same workdir +# with index=off - expect success +_overlay_mount_dirs $lowerdir2 $upperdir2 $workdir \ + overlay1 $SCRATCH_MNT -oindex=off && \ + $UMOUNT_PROG $SCRATCH_MNT + +# Try to mount another overlay with the same upperdir +# with index=on - expect EBUSY _overlay_mount_dirs $lowerdir2 $upperdir $workdir2 \ - overlay2 $SCRATCH_MNT 2>&1 | _filter_scratch -# Try to mount another overlay with the same workdir - expect EBUSY + overlay2 $SCRATCH_MNT -oindex=on 2>&1 | _filter_scratch + +# Try to mount another overlay with the same workdir +# with index=on - expect EBUSY _overlay_mount_dirs $lowerdir2 $upperdir2 $workdir \ - overlay3 $SCRATCH_MNT 2>&1 | _filter_scratch + overlay3 $SCRATCH_MNT -oindex=on 2>&1 | _filter_scratch + # success, all done status=0