]> git.proxmox.com Git - mirror_zfs.git/blobdiff - tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_002_pos.ksh
Sequential scrub and resilvers
[mirror_zfs.git] / tests / zfs-tests / tests / functional / cli_root / zpool_scrub / zpool_scrub_002_pos.ksh
index 26c22fd98a83ae41e3964770b6d9c76676dca439..712097bb1ca8d7f37176fb3996afac862e964d0d 100755 (executable)
@@ -46,9 +46,9 @@
 #      6. Verify zpool scrub -s succeed when the system is scrubbing.
 #
 # NOTES:
-#      A 10ms delay is added to the ZIOs in order to ensure that the
-#      scrub does not complete before it has a chance to be cancelled.
-#      This can occur when testing with small pools or very fast hardware.
+#      Artificially limit the scrub speed by setting the zfs_scan_vdev_limit
+#      low and adding a 50ms zio delay in order to ensure that the scrub does
+#      not complete early.
 #
 
 verify_runnable "global"
@@ -56,13 +56,21 @@ verify_runnable "global"
 function cleanup
 {
        log_must zinject -c all
+       log_must set_tunable64 zfs_scan_vdev_limit $ZFS_SCAN_VDEV_LIMIT_DEFAULT
+       log_must rm -f $mntpnt/biggerfile
 }
 
 log_onexit cleanup
 
 log_assert "Verify scrub, scrub -p, and scrub -s show the right status."
 
-log_must zinject -d $DISK1 -D20:1 $TESTPOOL
+# Create 1G of additional data
+mntpnt=$(get_prop mountpoint $TESTPOOL/$TESTFS)
+log_must file_write -b 1048576 -c 1024 -o create -d 0 -f $mntpnt/biggerfile
+log_must sync
+
+log_must zinject -d $DISK1 -D50:1 $TESTPOOL
+log_must set_tunable64 zfs_scan_vdev_limit $ZFS_SCAN_VDEV_LIMIT_SLOW
 log_must zpool scrub $TESTPOOL
 log_must is_pool_scrubbing $TESTPOOL true
 log_must zpool scrub -p $TESTPOOL