-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dnode stress test to test dirty dnode corruption: #15526 Signed-off-by: Tony Hutter <[email protected]>
- Loading branch information
1 parent
acb33ee
commit 35d37d3
Showing
6 changed files
with
160 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/ksh -p | ||
# | ||
# CDDL HEADER START | ||
# | ||
# The contents of this file are subject to the terms of the | ||
# Common Development and Distribution License (the "License"). | ||
# You may not use this file except in compliance with the License. | ||
# | ||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | ||
# or https://opensource.org/licenses/CDDL-1.0. | ||
# See the License for the specific language governing permissions | ||
# and limitations under the License. | ||
# | ||
# When distributing Covered Code, include this CDDL HEADER in each | ||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. | ||
# If applicable, add the following below this CDDL HEADER, with the | ||
# fields enclosed by brackets "[]" replaced with your own identifying | ||
# information: Portions Copyright [yyyy] [name of copyright owner] | ||
# | ||
# CDDL HEADER END | ||
# | ||
|
||
# | ||
# Copyright 2007 Sun Microsystems, Inc. All rights reserved. | ||
# Use is subject to license terms. | ||
# | ||
|
||
# | ||
# Copyright (c) 2013 by Delphix. All rights reserved. | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
|
||
verify_runnable "global" | ||
|
||
default_cleanup |
80 changes: 80 additions & 0 deletions
80
tests/zfs-tests/tests/functional/dnode_stress/dnode_stress.ksh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!/bin/ksh -p | ||
# | ||
# CDDL HEADER START | ||
# | ||
# The contents of this file are subject to the terms of the | ||
# Common Development and Distribution License (the "License"). | ||
# You may not use this file except in compliance with the License. | ||
# | ||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | ||
# or https://opensource.org/licenses/CDDL-1.0. | ||
# See the License for the specific language governing permissions | ||
# and limitations under the License. | ||
# | ||
# When distributing Covered Code, include this CDDL HEADER in each | ||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. | ||
# If applicable, add the following below this CDDL HEADER, with the | ||
# fields enclosed by brackets "[]" replaced with your own identifying | ||
# information: Portions Copyright [yyyy] [name of copyright owner] | ||
# | ||
# CDDL HEADER END | ||
# | ||
# Stress the dirty dnode bug: | ||
# issue - https://github.com/openzfs/zfs/issues/15526 | ||
# fix - https://github.com/openzfs/zfs/pull/15571) | ||
# | ||
# Copyright (c) 2023 by Lawrence Livermore National Security, LLC. | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
. $STF_SUITE/tests/functional/reservation/reservation.shlib | ||
. $STF_SUITE/tests/functional/zvol/zvol_common.shlib | ||
|
||
verify_runnable "global" | ||
|
||
function reproducer { | ||
cd /$TESTPOOL | ||
mypid=$(exec sh -c 'echo $PPID') | ||
|
||
prefix="reproducer_${mypid}_" | ||
log_must dd if=/dev/urandom of=${prefix}0 bs=64k count=1 status=none | ||
|
||
log_note "writing files" | ||
end=25000 | ||
h=0 | ||
for i in `seq 1 2 $end` ; do | ||
let "j=$i+1" | ||
cp ${prefix}$h ${prefix}$i | ||
cp --reflink=never ${prefix}$i ${prefix}$j | ||
let "h++" | ||
done | ||
} | ||
|
||
spawn=4 | ||
for i in `seq 1 $spawn` ; do | ||
reproducer & | ||
pids[$i]=$! | ||
done | ||
|
||
log_note "Waiting" | ||
wait | ||
log_note "Checking files" | ||
fail=0 | ||
cd /$TESTPOOL | ||
for i in `seq 1 $spawn` ; do | ||
mypid=${pids[$i]} | ||
prefix="reproducer_${mypid}_" | ||
out="$(diff -q ${prefix}0 ${prefix}$i)" | ||
if [ $? != 0 ] ; then | ||
log_note "$mypid: failed match ${prefix}0 ${prefix}$i" | ||
log_note "$mypid: ls: $(ls -l ${prefix}0 ${prefix}$i)" | ||
log_note "$mypid: diff: $out" | ||
fail=1 | ||
fi | ||
done | ||
cd | ||
|
||
if [ "$fail" == "1" ] ; then | ||
log_fail "Saw dirty dnode corruption" | ||
fi | ||
|
||
log_pass "Saw no dirty dnode corruption" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/ksh -p | ||
# | ||
# CDDL HEADER START | ||
# | ||
# The contents of this file are subject to the terms of the | ||
# Common Development and Distribution License (the "License"). | ||
# You may not use this file except in compliance with the License. | ||
# | ||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | ||
# or https://opensource.org/licenses/CDDL-1.0. | ||
# See the License for the specific language governing permissions | ||
# and limitations under the License. | ||
# | ||
# When distributing Covered Code, include this CDDL HEADER in each | ||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. | ||
# If applicable, add the following below this CDDL HEADER, with the | ||
# fields enclosed by brackets "[]" replaced with your own identifying | ||
# information: Portions Copyright [yyyy] [name of copyright owner] | ||
# | ||
# CDDL HEADER END | ||
# | ||
|
||
# | ||
# Copyright 2009 Sun Microsystems, Inc. All rights reserved. | ||
# Use is subject to license terms. | ||
# | ||
|
||
# | ||
# Copyright (c) 2013 by Delphix. All rights reserved. | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
|
||
verify_runnable "global" | ||
|
||
default_setup "$DISKS" |