All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Larsson <alexl@redhat.com>
To: miklos@szeredi.hu
Cc: linux-unionfs@vger.kernel.org, amir73il@gmail.com,
	Alexander Larsson <alexl@redhat.com>
Subject: [PATCH v3 0/6] Support nested overlayfs mounts
Date: Thu,  7 Sep 2023 10:44:05 +0200	[thread overview]
Message-ID: <cover.1694075674.git.alexl@redhat.com> (raw)

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, becasue 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.

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 (6):
  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: Handle escaped xwhiteouts across layers
  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                   | 312 ++++++++++++++++++++++++
 10 files changed, 443 insertions(+), 213 deletions(-)
 create mode 100644 fs/overlayfs/xattrs.c

-- 
2.41.0


             reply	other threads:[~2023-09-07 18:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-07  8:44 Alexander Larsson [this message]
2023-09-07  8:44 ` [PATCH v3 1/6] ovl: Move xattr support to new xattrs.c file Alexander Larsson
2023-09-07  8:44 ` [PATCH v3 2/6] ovl: Add OVL_XATTR_TRUSTED/USER_PREFIX_LEN macros Alexander Larsson
2023-09-07  8:44 ` [PATCH v3 3/6] ovl: Support escaped overlay.* xattrs Alexander Larsson
2023-09-07 11:24   ` Amir Goldstein
     [not found]     ` <CAL7ro1FMVdFPu5WqxHCoGTcpt8P532z02sx1Ngtf6BW61WPDGg@mail.gmail.com>
2023-09-08  7:52       ` Amir Goldstein
2023-09-07  8:44 ` [PATCH v3 4/6] ovl: Add an alternative type of whiteout Alexander Larsson
2023-09-07 12:06   ` Amir Goldstein
2023-09-07  8:44 ` [PATCH v3 5/6] ovl: Handle escaped xwhiteouts across layers Alexander Larsson
2023-09-07 12:27   ` Amir Goldstein
     [not found]     ` <CAL7ro1F2vxqp5gwvRzavZ6QRVw57+RHxv=iHJk-Z9X3_ibg21w@mail.gmail.com>
2023-09-08 11:19       ` Amir Goldstein
2023-09-07  8:44 ` [PATCH v3 6/6] ovl: Add documentation on nesting of overlayfs mounts Alexander Larsson
2023-09-07 10:57   ` Amir Goldstein
2023-09-07 13:22 ` [PATCH v3 0/6] Support nested " Amir Goldstein
     [not found]   ` <CAL7ro1Fm72xndy1C0zZbScPtgjGXucZ3rip0cO4VutSu0Jy4-A@mail.gmail.com>
2023-09-08  7:47     ` Amir Goldstein

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=cover.1694075674.git.alexl@redhat.com \
    --to=alexl@redhat.com \
    --cc=amir73il@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.