Re: [PATCH v3 0/6] Support nested overlayfs mounts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 7, 2023 at 11:44 AM Alexander Larsson <alexl@xxxxxxxxxx> 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, 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.
>

This test look good. Left minor comments in github.
Missing test for the perplexing "escaped xwhiteouts across layers" use case.

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

I think we don't need an opt-in mount option, but would like to know
what Miklos thinks?

We can fix the test this way:

setfattr trusted.overlayfsrz
verify success
getfattr trusted.overlayfsrz
verify success AND that xattr was not escaped

setfattr trusted.overlay.fsz
verify failure OR that xattr was escaped
getfattr trusted.overlay.fsz
verify failure OR that xattr was escaped

Thanks,
Amir.

>
> 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
>




[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux