linux-unionfs mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Alexander Larsson <alexl@redhat.com>
Cc: miklos@szeredi.hu, linux-unionfs@vger.kernel.org
Subject: Re: [PATCH v4 0/5] Support nested overlayfs mounts with xattrs and whiteous
Date: Tue, 12 Sep 2023 19:20:25 +0300	[thread overview]
Message-ID: <CAOQ4uxg5r5uVzjGfEHNsp5PENWhggGzqntB7Xp0xCcC+x0osLA@mail.gmail.com> (raw)
In-Reply-To: <CAL7ro1F9cuyXqQEgQHm1Fwo0vFJTUFVXuBXR-v9U1JUFpcW11Q@mail.gmail.com>

On Tue, Sep 12, 2023 at 6:36 PM Alexander Larsson <alexl@redhat.com> wrote:
>
>
>
> On Tue, Sep 12, 2023 at 2:08 PM Amir Goldstein <amir73il@gmail.com> wrote:
>>
>> On Tue, Sep 12, 2023 at 12:56 PM Alexander Larsson <alexl@redhat.com> wrote:
>> >
>> > There are cases where you want to use an overlayfs mount as a lowerdir for
>> > another overlayfs mount. For example, if the system rootfs is on overlayfs due
>> > to composefs, or to make it volatile (via tmpfs), then you cannot currently store
>> > a lowerdir on the rootfs, because the inner overlayfs will eat all the whiteouts
>> > and overlay xattrs. This means you can't e.g. store on the rootfs a prepared
>> > container image for use with overlayfs.
>> >
>> > This patch series adds support for nesting of overlayfs mounts by escaping the
>> > problematic features and unescaping them when exposing to the overlayfs user.
>> >
>> > This series is also available here:
>> >   https://github.com/alexlarsson/linux/tree/ovl-nesting
>> >
>> > And xfstest to test it is available here:
>> >   https://github.com/alexlarsson/xfstests/tree/overlayfs-nesting
>> >
>> > The overlay/083 test checks both xattr escaping, the new whiteouts as well as
>> > actual nesting of overlayfs.
>> >
>> > Note that this series breaks the overlay/026 test which validates that
>> > writing overlay.* xattrs is not supported, but it now is. I'm not sure
>> > if we should fix this test to not fail, or if we should make this an
>> > opt-in mount feature.
>>
>> Please fix the test as we discussed:
>> 1. relax the requirement that getxattr trusted.overlay should fail
>> 2. set expectations for setxattr depending on result of getxattr
>>
>> This way we will not lose much test coverage for old kernels.
>> This test fix can be posted to fstests ahead of time as preparation
>> for your patch set.
>
>
> Added to  https://github.com/alexlarsson/xfstests/commits/overlayfs-nesting
>

Nice.

Not sure that you need "getattr ok" in the golden output.

Also, if you test "legit failure" with [[ "$res" =~ "Operation not" ]]
there is no need to sed the output of [gs]etfattr not to _filter_scratch.
Those are only done to canonicalize the golder output.

However, test 083 failed all the xwhiteout test cases when I ran
it with your ovl-nesting-4 tag:

 == Check xwhiteout trusted ==
+hidden
 regular
-stat: cannot statx 'SCRATCH_MNT/hidden': No such file or directory
+  File: SCRATCH_MNT/hidden
...

>> Given that this version has dropped the controversial bits
>> and that the whiteout implementation is the one that was
>> proposed by Miklos, I don't see any problem with it now.
>> I can queue it up for 6.7 and if Miklos has any objections
>> or comments, we have enough time to address them.
>>
>
> That sounds good to me.
>
>>
>> Thanks,
>> Amir.
>>
>> >
>> > Changes since v3:
>> >  * Dropped the handling of whiteout xattrs across layers.
>> >  * Copy-up escaped overlayfs xattrs.
>> >  * Minor code cleanups.
>> >
>> > Changes since v2:
>> >  * Uses a new approach for escaping whiteouts with a regular file with an
>> >    overlay.whiteout xattr in a lower directory with an overlay.whiteouts
>> >    xattr.
>> >
>> > Changes since v1:
>> >
>> >  * Moved all xattr handling to xattr.c
>> >  * Made creation of escaped whiteouts atomic
>> >
>> > Alexander Larsson (5):
>> >   ovl: Move xattr support to new xattrs.c file
>> >   ovl: Add OVL_XATTR_TRUSTED/USER_PREFIX_LEN macros
>> >   ovl: Support escaped overlay.* xattrs
>> >   ovl: Add an alternative type of whiteout
>> >   ovl: Add documentation on nesting of overlayfs mounts
>> >
>> >  Documentation/filesystems/overlayfs.rst |  23 ++
>> >  fs/overlayfs/Makefile                   |   2 +-
>> >  fs/overlayfs/dir.c                      |   4 +-
>> >  fs/overlayfs/inode.c                    | 124 -----------
>> >  fs/overlayfs/namei.c                    |  15 +-
>> >  fs/overlayfs/overlayfs.h                |  42 +++-
>> >  fs/overlayfs/readdir.c                  |  27 ++-
>> >  fs/overlayfs/super.c                    |  67 +-----
>> >  fs/overlayfs/util.c                     |  40 ++++
>> >  fs/overlayfs/xattrs.c                   | 273 ++++++++++++++++++++++++
>> >  10 files changed, 404 insertions(+), 213 deletions(-)
>> >  create mode 100644 fs/overlayfs/xattrs.c
>> >
>> > --
>> > 2.41.0
>> >
>>
>
>
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>  Alexander Larsson                                Red Hat, Inc
>        alexl@redhat.com         alexander.larsson@gmail.com

      parent reply	other threads:[~2023-09-12 16:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12  9:55 [PATCH v4 0/5] Support nested overlayfs mounts with xattrs and whiteous Alexander Larsson
2023-09-12  9:55 ` [PATCH v4 1/5] ovl: Move xattr support to new xattrs.c file Alexander Larsson
2023-09-12  9:55 ` [PATCH v4 2/5] ovl: Add OVL_XATTR_TRUSTED/USER_PREFIX_LEN macros Alexander Larsson
2023-09-12  9:55 ` [PATCH v4 3/5] ovl: Support escaped overlay.* xattrs Alexander Larsson
2023-09-12 12:05   ` Amir Goldstein
2023-09-12  9:55 ` [PATCH v4 4/5] ovl: Add an alternative type of whiteout Alexander Larsson
2023-09-12  9:55 ` [PATCH v4 5/5] ovl: Add documentation on nesting of overlayfs mounts Alexander Larsson
2023-09-12 12:08 ` [PATCH v4 0/5] Support nested overlayfs mounts with xattrs and whiteous Amir Goldstein
     [not found]   ` <CAL7ro1F9cuyXqQEgQHm1Fwo0vFJTUFVXuBXR-v9U1JUFpcW11Q@mail.gmail.com>
2023-09-12 16:20     ` Amir Goldstein [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOQ4uxg5r5uVzjGfEHNsp5PENWhggGzqntB7Xp0xCcC+x0osLA@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=alexl@redhat.com \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).