Created
November 22, 2023 22:12
-
-
Save tonyhutter/d69f305508ae3b7ff6e9263b22031a84 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# | |
# Run this script multiple times in parallel inside your pool's mount | |
# to reproduce https://github.com/openzfs/zfs/issues/15526. Like: | |
# | |
# ./reproducer.sh & ./reproducer.sh & ./reproducer.sh & /reproducer.sh & wait | |
# | |
if [ $(cat /sys/module/zfs/parameters/zfs_bclone_enabled) != "1" ] ; then | |
echo "please set /sys/module/zfs/parameters/zfs_bclone_enabled = 1" | |
exit | |
fi | |
prefix="reproducer_${BASHPID}_" | |
dd if=/dev/urandom of=${prefix}0 bs=1M count=1 status=none | |
echo "writing files" | |
end=1000 | |
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 | |
echo "checking files" | |
for i in `seq 1 $end` ; do | |
diff ${prefix}0 ${prefix}$i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Illumos version is in https://www.illumos.org/issues/16087#note-6