On Tue, Apr 8, 2025 at 5:45 PM Miklos Szeredi <mszeredi@xxxxxxxxxx> wrote: > > New kernel feature (target release is v6.16) allows data-only redirect to > be enabled without metacopy and redirect_dir turned on. This works with or > without verity enabled. > > Tests are done with the userxattr option, to verify that it will work in a > user namespace. > > Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxxxxx> With some minor nits below fixed, you may add: Reviewed-by: Amir Goldstein <amir73il@xxxxxxxxx> > --- > common/overlay | 29 +++++ > tests/overlay/088 | 296 ++++++++++++++++++++++++++++++++++++++++++ > tests/overlay/088.out | 39 ++++++ > tests/overlay/089 | 272 ++++++++++++++++++++++++++++++++++++++ > tests/overlay/089.out | 5 + > 5 files changed, 641 insertions(+) > create mode 100755 tests/overlay/088 > create mode 100644 tests/overlay/088.out > create mode 100755 tests/overlay/089 > create mode 100644 tests/overlay/089.out > ... > +test_common() > +{ > + local _lowerdir=$1 _datadir2=$2 _datadir=$3 > + local _target=$4 _size=$5 _blocks=$6 _data="$7" > + local _redirect=$8 > + > + echo "Mount ro" > + mount_ro_overlay $_lowerdir $_datadir2 $_datadir > + > + # Check redirect xattr to lowerdata > + [ -n "$_redirect" ] && check_redirect $lowerdir/$_target "$_redirect" > + > + echo "check properties of metadata copied up file $_target" Remove "metadata" > + check_file_size_contents $SCRATCH_MNT/$_target $_size "$_data" > + check_file_blocks $SCRATCH_MNT/$_target $_blocks > + > + # Do a mount cycle and check size and contents again. > + echo "Unmount and Mount rw" > + umount_overlay > + mount_overlay $_lowerdir $_datadir2 $_datadir > + echo "check properties of metadata copied up file $_target" Remove "metadata" > + check_file_size_contents $SCRATCH_MNT/$_target $_size "$_data" > + check_file_blocks $SCRATCH_MNT/$_target $_blocks > + > + # Trigger metadata copy up and check absence of metacopy xattr. Wrong description. maybe # Trigger copy up and check upper file properties. > + chmod 400 $SCRATCH_MNT/$_target > + umount_overlay > + check_file_size_contents $upperdir/$_target $_size "$_data" > +} > + ... > diff --git a/tests/overlay/088.out b/tests/overlay/088.out > new file mode 100644 > index 000000000000..c85c998d503a > --- /dev/null > +++ b/tests/overlay/088.out > @@ -0,0 +1,39 @@ > +QA output created by 088 > + ... > + > +== Check follow to lowerdata layer with absolute redirect == > +Mount ro > +check properties of metadata copied up file datafile > +Unmount and Mount rw > +check properties of metadata copied up file datafile > +Mount ro > +check properties of metadata copied up file datafile2 > +Unmount and Mount rw > +check properties of metadata copied up file datafile2 > +Mount ro > +check properties of metadata copied up file shared > +Unmount and Mount rw > +check properties of metadata copied up file shared > + For all of the above - remove "metadata" Thanks, Amir.