1#! /bin/ksh -p 2# 3# CDDL HEADER START 4# 5# The contents of this file are subject to the terms of the 6# Common Development and Distribution License (the "License"). 7# You may not use this file except in compliance with the License. 8# 9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10# or https://opensource.org/licenses/CDDL-1.0. 11# See the License for the specific language governing permissions 12# and limitations under the License. 13# 14# When distributing Covered Code, include this CDDL HEADER in each 15# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16# If applicable, add the following below this CDDL HEADER, with the 17# fields enclosed by brackets "[]" replaced with your own identifying 18# information: Portions Copyright [yyyy] [name of copyright owner] 19# 20# CDDL HEADER END 21 22# 23# Copyright (c) 2023 by Lawrence Livermore National Security, LLC. 24# 25 26. $STF_SUITE/include/libtest.shlib 27 28# 29# DESCRIPTION: 30# 31# https://github.com/openzfs/zfs/issues/15526 identified a dirty dnode 32# SEEK_HOLE/SEEK_DATA bug. https://github.com/openzfs/zfs/pull/15571 33# fixed the bug, and was backported to 2.1.14 and 2.2.2. 34# 35# This test is to ensure that the bug, as understood, will not recur. 36# 37# STRATEGY: 38# 39# 1. Run the 'seekflood' binary, for creation of files with timing 40# characteristics that can trigger #15526. 41# 2. A single run is not always a trigger, so run repeatedly. 42 43verify_runnable "global" 44 45function cleanup 46{ 47 rm -rf /$TESTDIR/cp_stress 48} 49 50log_assert "Run the 'seekflood' binary repeatedly to try to trigger #15526" 51 52log_onexit cleanup 53 54log_must mkdir /$TESTPOOL/cp_stress 55 56MYPWD="$PWD" 57cd /$TESTPOOL/cp_stress 58CPUS=$(get_num_cpus) 59 60if is_freebsd ; then 61 # 'seekflood' takes longer on FreeBSD and can timeout the test 62 RUNS=3 63else 64 RUNS=10 65fi 66 67for i in $(seq 1 $RUNS) ; do 68 # Each run takes around 12 seconds. 69 log_must $STF_SUITE/tests/functional/cp_files/seekflood 2000 $CPUS 70done 71cd "$MYPWD" 72 73log_pass "No corruption detected" 74