overlay/065: adjust test to expect EBUSY only with index=on
PATCH 1/1 overlay/065: adjust test to expect EBUSY only with index=on
This is needed to support the kernel regression fix commit 0be0bfd2de9d ("ovl: fix regression caused by overlapping layers detection").
Overlayfs mount is not supposed to fail due to upper/work dir in-use by other mount unless option index=on is enabled.
---
Eryu,
With this applied, test is expected to fail on upstream kernel, because upstream kernel has a regression.
The kernel fix commit is on Miklos' overlayfs-next branch.
Thanks,
Amir.
tests/overlay/065 | 26 ++++++++++++++++---------- tests/overlay/065.out | 4 ++-- 2 files changed, 18 insertions(+), 12 deletions(-)
tests/overlay/065 +16 -10
@@ -13,9 +13,14 @@ # # Overlapping layers on mount or lookup results in ELOOP. # Overlapping lowerdir with other mount upperdir/workdir -# result in EBUSY. +# result in EBUSY (if index=on is used). # -# Kernel patch "ovl: detect overlapping layers" is needed to pass the test. +# This is a regression test for kernel commit: +# +# 146d62e5a586 "ovl: detect overlapping layers" +# +# and its followup fix commit: +# 0be0bfd2de9d "ovl: fix regression caused by overlapping layers detection" # seq=`basename $0` seqres=$RESULT_DIR/$seq
@@ -46,6 +51,7 @@ _supported_os Linux # Use non-default scratch underlying overlay dirs, we need to check # them explicity after test. _require_scratch_nocheck +_require_scratch_feature index # Remove all files from previous tests _scratch_mkfs
@@ -61,10 +67,10 @@ mnt2=$basedir/mnt.2 mkdir -p $lowerdir/lower $upperdir $workdir -# Try to mount an overlay with the same upperdir/lowerdir - expect EBUSY +# Try to mount an overlay with the same upperdir/lowerdir - expect ELOOP echo Conflicting upperdir/lowerdir _overlay_scratch_mount_dirs $upperdir $upperdir $workdir \ - 2>&1 | _filter_busy_mount + 2>&1 | _filter_error_mount $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null # Use new upper/work dirs for each test to avoid ESTALE errors
@@ -72,11 +78,11 @@ $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir $upperdir $workdir -# Try to mount an overlay with the same workdir/lowerdir - expect EBUSY +# Try to mount an overlay with the same workdir/lowerdir - expect ELOOP # because $workdir/work overlaps with lowerdir echo Conflicting workdir/lowerdir _overlay_scratch_mount_dirs $workdir $upperdir $workdir \ - 2>&1 | _filter_busy_mount + -oindex=off 2>&1 | _filter_error_mount $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir
@@ -126,20 +132,20 @@ rm -rf $upperdir2 $workdir2 mkdir -p $upperdir2 $workdir2 $mnt2 # Try to mount an overlay with layers overlapping with another overlayfs -# upperdir - expect EBUSY +# upperdir - expect EBUSY with index=on echo Overlapping with upperdir of another instance _overlay_scratch_mount_dirs $upperdir/upper $upperdir2 $workdir2 \ - 2>&1 | _filter_busy_mount + -oindex=on 2>&1 | _filter_busy_mount $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null rm -rf $upperdir2 $workdir2 mkdir -p $upperdir2 $workdir2 # Try to mount an overlay with layers overlapping with another overlayfs -# workdir - expect EBUSY +# workdir - expect EBUSY with index=on echo Overlapping with workdir of another instance _overlay_scratch_mount_dirs $workdir/work $upperdir2 $workdir2 \ - 2>&1 | _filter_busy_mount + -oindex=on 2>&1 | _filter_busy_mount $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null # Move upper layer root into lower layer after mount
tests/overlay/065.out +2 -2
@@ -1,8 +1,8 @@ QA output created by 065 Conflicting upperdir/lowerdir -mount: device already mounted or mount point busy +mount: Too many levels of symbolic links Conflicting workdir/lowerdir -mount: device already mounted or mount point busy +mount: Too many levels of symbolic links Overlapping upperdir/lowerdir mount: Too many levels of symbolic links Conflicting lower layers
Signature · 1 line
2.17.1
Quoted 5 lines · Amir Goldstein
This is needed to support the kernel regression fix commit
0be0bfd2de9d("ovl: fix regression caused by overlapping layers detection").Overlayfs mount is not supposed to fail due to upper/work dir in-use by other mount unless option index=on is enabled.
Sorry for the late review.. Looks like this patch only mount overlay with "index=on" explicitly, but doesn't check that mount succeeds when "index=off", which is really regressed. Do we need to add more "index=off" tests to ensure we allow re-use upperdir?
Thanks,
Eryu
Quoted 117 lines
Signed-off-by Amir Goldstein <[email protected]>---
Eryu,
With this applied, test is expected to fail on upstream kernel, because upstream kernel has a regression.
The kernel fix commit is on Miklos' overlayfs-next branch.
Thanks,
Amir.tests/overlay/065 | 26 ++++++++++++++++---------- tests/overlay/065.out | 4 ++-- 2 files changed, 18 insertions(+), 12 deletions(-)tests/overlay/065 +16
-10@@ -13,9 +13,14 @@ # # Overlapping layers on mount or lookup results in ELOOP. # Overlapping lowerdir with other mount upperdir/workdir -# result in EBUSY. +# result in EBUSY (if index=on is used). # -# Kernel patch "ovl: detect overlapping layers" is needed to pass the test. +# This is a regression test for kernel commit: +# +# 146d62e5a586 "ovl: detect overlapping layers" +# +# and its followup fix commit: +# 0be0bfd2de9d "ovl: fix regression caused by overlapping layers detection" # seq=`basename $0` seqres=$RESULT_DIR/$seq@@ -46,6 +51,7 @@ _supported_os Linux # Use non-default scratch underlying overlay dirs, we need to check # them explicity after test. _require_scratch_nocheck +_require_scratch_feature index # Remove all files from previous tests _scratch_mkfs@@ -61,10 +67,10 @@ mnt2=$basedir/mnt.2 mkdir -p $lowerdir/lower $upperdir $workdir -# Try to mount an overlay with the same upperdir/lowerdir - expect EBUSY +# Try to mount an overlay with the same upperdir/lowerdir - expect ELOOP echo Conflicting upperdir/lowerdir _overlay_scratch_mount_dirs $upperdir $upperdir $workdir \ - 2>&1 | _filter_busy_mount + 2>&1 | _filter_error_mount $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null # Use new upper/work dirs for each test to avoid ESTALE errors@@ -72,11 +78,11 @@ $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir mkdir $upperdir $workdir -# Try to mount an overlay with the same workdir/lowerdir - expect EBUSY +# Try to mount an overlay with the same workdir/lowerdir - expect ELOOP # because $workdir/work overlaps with lowerdir echo Conflicting workdir/lowerdir _overlay_scratch_mount_dirs $workdir $upperdir $workdir \ - 2>&1 | _filter_busy_mount + -oindex=off 2>&1 | _filter_error_mount $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null rm -rf $upperdir $workdir@@ -126,20 +132,20 @@ rm -rf $upperdir2 $workdir2 mkdir -p $upperdir2 $workdir2 $mnt2 # Try to mount an overlay with layers overlapping with another overlayfs -# upperdir - expect EBUSY +# upperdir - expect EBUSY with index=on echo Overlapping with upperdir of another instance _overlay_scratch_mount_dirs $upperdir/upper $upperdir2 $workdir2 \ - 2>&1 | _filter_busy_mount + -oindex=on 2>&1 | _filter_busy_mount $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null rm -rf $upperdir2 $workdir2 mkdir -p $upperdir2 $workdir2 # Try to mount an overlay with layers overlapping with another overlayfs -# workdir - expect EBUSY +# workdir - expect EBUSY with index=on echo Overlapping with workdir of another instance _overlay_scratch_mount_dirs $workdir/work $upperdir2 $workdir2 \ - 2>&1 | _filter_busy_mount + -oindex=on 2>&1 | _filter_busy_mount $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null # Move upper layer root into lower layer after mounttests/overlay/065.out +2
-2@@ -1,8 +1,8 @@ QA output created by 065 Conflicting upperdir/lowerdir -mount: device already mounted or mount point busy +mount: Too many levels of symbolic links Conflicting workdir/lowerdir -mount: device already mounted or mount point busy +mount: Too many levels of symbolic links Overlapping upperdir/lowerdir mount: Too many levels of symbolic links Conflicting lower layersSignature · 1 line
2.17.1
Quoted 5 lines · Eryu Guan
Quoted 3 lines · Amir Goldstein
This is needed to support the kernel regression fix commit
0be0bfd2de9d("ovl: fix regression caused by overlapping layers detection").
Quoted 7 lines
Quoted 2 lines
Overlayfs mount is not supposed to fail due to upper/work dir in-use by other mount unless option index=on is enabled.
Sorry for the late review.. Looks like this patch only mount overlay with "index=on" explicitly, but doesn't check that mount succeeds when "index=off", which is really regressed. Do we need to add more "index=off" tests to ensure we allow re-use upperdir?
Agreed!
Thanks,
Amir.