All files in lower/upper dirs should be removed for overlayfs in
_scratch_cleanup_files(), not only files in merged dir, otherwise files
from lower dir won't be removed.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
# remove all files in $SCRATCH_MNT, useful when testing on NFS/CIFS
_scratch_cleanup_files()
{
- _scratch_mount
- rm -rf $SCRATCH_MNT/*
- _scratch_unmount
+ case $FSTYP in
+ overlay)
+ # $SCRATCH_DEV is a valid directory in overlay case
+ rm -rf $SCRATCH_DEV/*
+ ;;
+ *)
+ _scratch_mount
+ rm -rf $SCRATCH_MNT/*
+ _scratch_unmount
+ ;;
+ esac
}
_scratch_mkfs()