From patchwork Sun Jun 6 15:18:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 12302053 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A34DC4743D for ; Sun, 6 Jun 2021 15:19:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E5686142B for ; Sun, 6 Jun 2021 15:19:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230091AbhFFPVG (ORCPT ); Sun, 6 Jun 2021 11:21:06 -0400 Received: from mail-wm1-f51.google.com ([209.85.128.51]:36494 "EHLO mail-wm1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230085AbhFFPVF (ORCPT ); Sun, 6 Jun 2021 11:21:05 -0400 Received: by mail-wm1-f51.google.com with SMTP id n17-20020a7bc5d10000b0290169edfadac9so10925891wmk.1; Sun, 06 Jun 2021 08:19:15 -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 :mime-version:content-transfer-encoding; bh=YoubEMIy04CfGf8rnarF9MdAHC21+/mFWslYuRba1Jg=; b=abJpzNe1hZakvFjqHoUUq8viRlYToCi7wBaNXkLI3+lMVFtghJpCa0/1/ETYlAber5 u83+J6bCuOfxzUMIerps1+O4b3iB3uf25BNmI6TJygc+YS4Mj1drEo79LvNmAsIz41WL gWOKbIBkZM7/qicZeTlS8xp7kJkk6fWtWCPgSMrM2Zufeijsk65KJIGTIwuDiqzQ6n5M Lu93q01zRgT1G2hges0ZpdRKCXJtw4C3cn08sATtfJGZun/7qUJGIuoKDozUk3Vixw3H 0jkL5keHc/oBTVqC5yLqAh7v0qHzuIrrlYB1o66vOIKuF8qsn1Y0TayyfhvZDtGF+Yz8 nxnA== 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:mime-version:content-transfer-encoding; bh=YoubEMIy04CfGf8rnarF9MdAHC21+/mFWslYuRba1Jg=; b=G/+7SK5SGXP8/y97ZOB00QhUXAnEMHRDzrDn3OoSvQW8qabupg0CYIBjYgsv/Qw1sr +NUEhIrMsz8M0CA61IyXZ5S7TvsIOD2nI/JIcXnWLUfoGFTm7LarDGd79w2N0JJpff+y 1QyuJ5XcIN6qdYvVaVbXxKGjO8t/mxLv9Bb7HOgzxfVBsq9m+Yi3Cb9Mt3PPbcxmPfOz JaeF//IjLha/tZrHcdzPO1W9wdJpfh7N5LegsR3Mgcq+EQd6yJoGea/Cw29EVgTB0Egv tk8dFWetS+YkjGWNarnn34zTNf2J1Id8L7QpRCvOGoq7inobpW5O3WFOqcZk8TmaaGZF vm9Q== X-Gm-Message-State: AOAM532ojfo9EY7Ka5J9tRoU1Dz3cWAPL5fuYLE43GvulLf7o6s7FGWB mKG0MvviJqHXfDX7Qidcjy0= X-Google-Smtp-Source: ABdhPJwFySamcZKg5Wz7XOj9JVA0jJVCcQWvNwn/cffIWpwgbWgNZGoWaSnRAfX6HRrRSqi3g893qw== X-Received: by 2002:a7b:c44f:: with SMTP id l15mr13006205wmi.151.1622992695463; Sun, 06 Jun 2021 08:18:15 -0700 (PDT) Received: from localhost.localdomain ([185.240.143.244]) by smtp.gmail.com with ESMTPSA id n9sm14996207wrt.81.2021.06.06.08.18.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Jun 2021 08:18:14 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH v2 1/2] overlay/075: fix wrong invocation of t_immutable Date: Sun, 6 Jun 2021 18:18:10 +0300 Message-Id: <20210606151811.420788-2-amir73il@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210606151811.420788-1-amir73il@gmail.com> References: <20210606151811.420788-1-amir73il@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org t_immutable cannot be run twice on the same test directoty, because append-only directory tests create files in append-only.d and those file already exist from the first run. Use separate test directories for the first and second t_immutable runs. Signed-off-by: Amir Goldstein --- tests/overlay/075 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/overlay/075 b/tests/overlay/075 index 5a6c3be0..02df1599 100755 --- a/tests/overlay/075 +++ b/tests/overlay/075 @@ -30,6 +30,7 @@ _cleanup() # we just need to remove the flags so use -R $timmutable -R $upperdir/testdir &> /dev/null $timmutable -R $lowerdir/testdir &> /dev/null + $timmutable -R $lowerdir/testdir.before &> /dev/null rm -f $tmp.* } @@ -45,13 +46,16 @@ _require_scratch _scratch_mkfs -# Preparing test area files in lower dir and check chattr support of base fs +# Check chattr support of base fs mkdir -p $lowerdir mkdir -p $upperdir -$timmutable -C $lowerdir/testdir >$tmp.out 2>&1 +$timmutable -C $lowerdir/testdir.before >$tmp.out 2>&1 if grep -q -e 'Operation not supported' -e "Inappropriate ioctl" $tmp.out; then _notrun "Setting immutable/append flag not supported" fi + +# Prepare test area files in lower dir +$timmutable -C $lowerdir/testdir >$tmp.out 2>&1 # Remove the immutable/append-only flags and create subdirs $timmutable -R $lowerdir/testdir >$tmp.out 2>&1 for dir in $lowerdir/testdir/*.d; do @@ -62,9 +66,9 @@ $timmutable -C $lowerdir/testdir >$tmp.out 2>&1 _scratch_mount -# Test immutability of files in overlay +# Test immutability of files in overlay before copy up echo "Before directories copy up" -$timmutable $SCRATCH_MNT/testdir 2>&1 +$timmutable $SCRATCH_MNT/testdir.before 2>&1 # Trigger copy-up of immutable/append-only dirs by touching their subdirs # inode flags are not copied-up, so immutable/append-only flags are lost From patchwork Sun Jun 6 15:18:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 12302055 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B15ADC4743E for ; Sun, 6 Jun 2021 15:19:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 93C2760FF0 for ; Sun, 6 Jun 2021 15:19:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230128AbhFFPVK (ORCPT ); Sun, 6 Jun 2021 11:21:10 -0400 Received: from mail-wr1-f43.google.com ([209.85.221.43]:39751 "EHLO mail-wr1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230088AbhFFPVH (ORCPT ); Sun, 6 Jun 2021 11:21:07 -0400 Received: by mail-wr1-f43.google.com with SMTP id l2so14510838wrw.6; Sun, 06 Jun 2021 08:19:17 -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 :mime-version:content-transfer-encoding; bh=/654+b4dmGVJIIeFeGch0w3vQDxjUg3DjZ5XmHt5mbw=; b=B+q7Q+PoIJEjfkQHAP9IIg06vgOYjAAgGjj1FK2OErDicgm6eRqrtILhjKLlybiL9R LrsJSCZEmhZd2vgaRqJx7MVOKNHuDZ3iOTb7fr8dQ9dv4SAcbk4zdYTta51p/E5QHwGq RU/ynQjZOKc+76A9oMRuk87U3THU6reyVrPct5w7311oAQUdSpqGYaL55scKakhcUS+A bISO+jDtyl/IRLpyBa3cPdpTOS5jfzfwEnAbgf8PbkEir3iPllBAMlkY0FpEq7BGLNRH V8u/exqtVNoTZrSxXNcS8X8pMaKCJdNXvJ8oGyGMtu+CV3k5A0opJYpHqbb5m4X1nUiV uplw== 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:mime-version:content-transfer-encoding; bh=/654+b4dmGVJIIeFeGch0w3vQDxjUg3DjZ5XmHt5mbw=; b=bV8PcD0ievKF0Mb57EdGR4bFbh0kIuvb5IEh/cNB08PCOVUW3ezuU1LBr6hM37SdEp SoGlyVvqlKtIuuJS8xqKsfaVaBDx2sLDuBrC8xXO8tRynBqLt5yBm6DchWuqe1J1EFgR CSlSF4bkbCr+u2RCaROGzdFkSFTywIKerTBgNP9OC5lXUP0IF1RZ1SB/beTpA3QgxI5w DwofU6NtAKRaR2bFgL6i/RcR4H/rYjzx8uqkC+GF2KRqd4a8wbG2vnWrRWKhpOUN1q6r es+Ak9ZaHVpObnG+OS+A1+vqvi6cyXsRvNDiIILmH/phTJiVjLRn/QjfiTkETF9bUW4Z AUEw== X-Gm-Message-State: AOAM5320hq2OpqkC2NN1NwUBuHRRSJAOjtBe+b3iKr6pdz+tjjfWR+JL MPA79OkT7iE/fL73U8UiAkc= X-Google-Smtp-Source: ABdhPJzrdxHhG2u0UKbJg2aIstUfw5LgYgLIIBrd++roZkLSIJ9QDszD/0FHyMduNy6b8g5CSdbb9w== X-Received: by 2002:a5d:4bc9:: with SMTP id l9mr13304082wrt.97.1622992696523; Sun, 06 Jun 2021 08:18:16 -0700 (PDT) Received: from localhost.localdomain ([185.240.143.244]) by smtp.gmail.com with ESMTPSA id n9sm14996207wrt.81.2021.06.06.08.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Jun 2021 08:18:16 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH v2 2/2] overlay/075: add test coverage for clearing immutable/append-only flags Date: Sun, 6 Jun 2021 18:18:11 +0300 Message-Id: <20210606151811.420788-3-amir73il@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210606151811.420788-1-amir73il@gmail.com> References: <20210606151811.420788-1-amir73il@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org overlay/075 is a variant of check -overlay generic/079. check -overlay generic/079 does the following operations on overlay fs: 1. Create files 2. Set immutable/append-only flags 3. Verify files/dirs behaving as immutable/append-only 4. Clear immutable/append-only flags 5. Remove files overlay/075 performs steps 1,2,4,5 on upper and lower layers and only step 3 is performed on overlay fs (before and after copy up and mount cycle). Add also steps 4,5 to be performed on overlay fs to increase the test coverage of the "merged" inode xflags feature. Signed-off-by: Amir Goldstein --- tests/overlay/075 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/overlay/075 b/tests/overlay/075 index 02df1599..f05858b3 100755 --- a/tests/overlay/075 +++ b/tests/overlay/075 @@ -69,6 +69,8 @@ _scratch_mount # Test immutability of files in overlay before copy up echo "Before directories copy up" $timmutable $SCRATCH_MNT/testdir.before 2>&1 +# Remove the immutable/append-only flags before mount cycle +$timmutable -R $SCRATCH_MNT/testdir.before &> /dev/null # Trigger copy-up of immutable/append-only dirs by touching their subdirs # inode flags are not copied-up, so immutable/append-only flags are lost @@ -88,9 +90,18 @@ done # After mount cycle, flags are forever lost _scratch_cycle_mount +# Verify that files can be deleted from overlay fs after clearing +# immutable/append-only flags and mount cycle +rm -rf $SCRATCH_MNT/testdir.before + # Test immutability of files in overlay after directories copy-up echo "After directories copy up" $timmutable $SCRATCH_MNT/testdir 2>&1 +# Verify that files can be deleted from overlay fs after clearing +# immutable/append-only flags +$timmutable -R $SCRATCH_MNT/testdir &> /dev/null +rm -rf $SCRATCH_MNT/testdir + status=$? exit