_overlay_scratch_mount()
{
if echo "$*" | grep -q remount; then
- $MOUNT_PROG $SCRATCH_MNT $*
+ # By default, libmount merges remount options with old mount options.
+ # overlayfs does not support re-configuring the same mount options.
+ # We workaround this problem with --options-mode ignore.
+ $MOUNT_PROG $SCRATCH_MNT --options-mode ignore $*
return
fi
# Verify that overlay is mounted read-only and that it cannot be remounted rw.
_overlay_scratch_mount_opts -o"lowerdir=$lowerdir2:$lowerdir1"
touch $SCRATCH_MNT/foo 2>&1 | _filter_scratch
-$MOUNT_PROG -o remount,rw $SCRATCH_MNT 2>&1 | _filter_ro_mount
+_scratch_remount rw 2>&1 | _filter_ro_mount
$UMOUNT_PROG $SCRATCH_MNT
# Make workdir immutable to prevent workdir re-create on mount