diff options
author | Amir Goldstein <amir73il@gmail.com> | 2023-07-10 11:07:12 +0200 |
---|---|---|
committer | Zorro Lang <zlang@kernel.org> | 2023-07-23 12:56:22 +0800 |
commit | 019122400875a59b02e35dc5d49e31c9b7b704e0 (patch) | |
tree | df78081424328a803bf2d89b42818bd81c546301 /common | |
parent | 5f8c60fe8140f7c8870c6e59114b49196b6678b5 (diff) |
overlay: Add test for follow of lowerdata in data-only layers
Add test coverage for following metacopy from lower layer to
data-only lower layers.
Data-only lower layers are configured using the syntax:
lowerdir=<lowerdir1>:<lowerdir2>::<lowerdata1>::<lowerdata2>.
Test that lowerdata files can be followed only by absolute redirect
from lower layer.
Test that with two lowerdata dirs, we can lookup individual lowerdata
files in both, and that a shared file is resolved from the uppermost
lowerdata dir.
There is also test case for lazy-data lookups, where we remove the
lowerdata file and validate that we get metadata from the metacopy
file, but open fails.
Signed-off-by: Alexander Larsson <alexl@redhat.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/overlay | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/common/overlay b/common/overlay index 452b3b09..816ed66d 100644 --- a/common/overlay +++ b/common/overlay @@ -201,6 +201,19 @@ _require_scratch_overlay_features() _scratch_unmount } +# Check kernel support for <lowerdirs>::<lowerdatadir> format +_require_scratch_overlay_lowerdata_layers() +{ + local lowerdirs="$OVL_BASE_SCRATCH_MNT/$OVL_UPPER::$OVL_BASE_SCRATCH_MNT/$OVL_LOWER" + + _scratch_mkfs > /dev/null 2>&1 + _overlay_scratch_mount_dirs "$lowerdirs" "-" "-" \ + -o ro,redirect_dir=follow,metacopy=on > /dev/null 2>&1 || \ + _notrun "overlay data-only layers not supported on ${SCRATCH_DEV}" + + _scratch_unmount +} + # Helper function to check underlying dirs of overlay filesystem _overlay_fsck_dirs() { |