mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
overlay: correct scratch dirs check
Tests that use _overlay_scratch_mount_dirs instead of _scratch_mount should use _require_scratch_nocheck instead of _require_scratch because these tests are either mounting with multiple lower dirs or mounting with non-default lower/upper/work dir, so _check_overlay_scratch_fs won't handle these cases correctly. So we introduce _overlay_check_scratch_dirs helper and should call this helper with the correct dir arguments for these non-default cases. This patch modify these tests to optionally call _overlay_check_scratch_dirs at the end of the test or after _scratch_umount to mount base filesystem only and run the checker. Signed-off-by: zhangyi (F) <yi.zhang@huawei.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
+8
-2
@@ -67,8 +67,10 @@ _cleanup()
|
||||
_supported_fs overlay
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_scratch
|
||||
_require_test_program "open_by_handle"
|
||||
# Use non-default scratch underlying overlay dirs, we need to check
|
||||
# them explicity after test.
|
||||
_require_scratch_nocheck
|
||||
# We need to require all features together, because nfs_export cannot
|
||||
# be enabled when index is disabled
|
||||
_require_scratch_overlay_features index nfs_export redirect_dir
|
||||
@@ -122,10 +124,14 @@ mount_dirs()
|
||||
-o "index=on,nfs_export=on,redirect_dir=on"
|
||||
}
|
||||
|
||||
# Unmount the overlay without unmounting base fs
|
||||
# Unmount the overlay without unmounting base fs and check the
|
||||
# underlying dirs
|
||||
unmount_dirs()
|
||||
{
|
||||
$UMOUNT_PROG $SCRATCH_MNT
|
||||
|
||||
_overlay_check_scratch_dirs $middle:$lower $upper $work \
|
||||
-o "index=on,nfs_export=on,redirect_dir=on"
|
||||
}
|
||||
|
||||
# Check file handles of dir with ancestor under lower redirect
|
||||
|
||||
Reference in New Issue
Block a user