Skip to content

Support nested overlayfs mounts with xattrs and whiteous

Alexander Larsson linux-unionfs 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 3 repliesIn review
  2. v36 patches 8 repliesSuperseded
  3. v25 patches 41 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches2 repliesSuperseded

Changes in v4 from the cover letter

* Dropped the handling of whiteout xattrs across layers.
* Copy-up escaped overlayfs xattrs.
* Minor code cleanups.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5ovl: Move xattr support to new xattrs.c filefs/overlayfs/Makefile fs/overlayfs/inode.c fs/overlayfs/overlayfs.h +2 more+209 -1980 replies
2/5ovl: Add OVL_XATTR_TRUSTED/USER_PREFIX_LEN macrosfs/overlayfs/overlayfs.h fs/overlayfs/xattrs.c+4 -20 replies
3/5ovl: Support escaped overlay.* xattrsfs/overlayfs/overlayfs.h fs/overlayfs/xattrs.c+85 -31 reply
4/5ovl: Add an alternative type of whiteoutfs/overlayfs/dir.c fs/overlayfs/namei.c fs/overlayfs/overlayfs.h +3 more+88 -150 replies
5/5ovl: Add documentation on nesting of overlayfs mountsDocumentation/filesystems/overlayfs.rst+23 -00 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchAmir Goldstein
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/5] Support nested overlayfs mounts with xattrs and whiteous

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.

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
Signature · 1 line
2.41.0