Files
mirror_zfs/tests/zfs-tests/include/commands.cfg
T
Gary Guo e7524594a9 Fix read corruption after block clone after truncate
When copy_file_range overwrites a recent truncation, subsequent reads
can incorrectly determine that it is read hole instead of reading the
cloned blocks.

This can happen when the following conditions are met:
- Truncate adds blkid to dn_free_ranges
- A new TXG is created
- copy_file_range calls dmu_brt_clone which override the block pointer
  and set DB_NOFILL
- Subsequent read, given DB_NOFILL, hits dbuf_read_impl and
  dbuf_read_hole
- dbuf_read_hole calls dnode_block_freed, which returns TRUE because the
  truncated blkids are still in dn_free_ranges

This will not happen if the clone and truncate are in the same TXG,
because the block clone would update the current TXG's dn_free_ranges,
which is why this bug only triggers under high IO load (such as
compilation).

Fix this by skipping the dnode_block_freed call if the block is
overridden. The fix shouldn't cause an issue when the cloned block is
subsequently freed in later TXGs, as dbuf_undirty would remove the
override.

This requires a dedicated test program as it is much harder to trigger
with scripts (this needs to generate a lot of I/O in short period of
time for the bug to trigger reliably).

Assisted-by: Gemini:gemini-3.1-pro
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Gary Guo <gary@kernel.org>
Closes #18412
Closes #18421
2026-04-23 15:02:27 -07:00

248 lines
3.3 KiB
INI

#
# Copyright (c) 2016, 2019 by Delphix. All rights reserved.
# These variables are used by zfs-tests.sh to constrain which utilities
# may be used by the suite. The suite will create a directory which is
# the only element of $PATH and create symlinks from that dir to the
# binaries listed below.
#
# Please keep the contents of each variable sorted for ease of reading
# and maintenance.
#
export SYSTEM_FILES_COMMON='awk
basename
bc
bunzip2
bzcat
cat
chgrp
chmod
chown
cksum
cmp
cp
cpio
cut
date
dd
df
diff
dirname
dmesg
du
echo
env
expr
false
file
find
fio
getconf
getent
getfacl
grep
gunzip
gzip
head
hostname
id
iostat
jq
kill
ksh
ldd
ln
ls
mkdir
mknod
mkfifo
mktemp
mount
mv
net
od
openssl
pamtester
pax
pgrep
ping
pkill
printf
ps
python3
readlink
rm
rmdir
rsync
scp
script
sed
seq
setfacl
sh
sleep
sort
ssh
stat
strings
sudo
swapoff
swapon
sync
tail
tar
timeout
touch
tr
true
truncate
umount
uname
uniq
vmstat
wc
which
xargs
xxh128sum'
export SYSTEM_FILES_FREEBSD='chflags
compress
diskinfo
fsck
getextattr
gpart
jail
jexec
jls
lsextattr
mdconfig
newfs
pw
rmextattr
setextattr
showmount
swapctl
sysctl
trim
uncompress'
export SYSTEM_FILES_LINUX='attr
blkid
blkdiscard
blockdev
chattr
cryptsetup
exportfs
fallocate
flock
free
getfattr
groupadd
groupdel
groupmod
hostid
logger
losetup
lsattr
lsblk
lscpu
lsmod
lsscsi
mkfs.xfs
mkswap
modprobe
mountpoint
mpstat
nsenter
parted
perf
setfattr
setpriv
udevadm
unshare
useradd
userdel
usermod
wipefs'
export ZFS_FILES='zdb
zfs
zhack
zinject
zpool
ztest
raidz_test
zarcsummary
zarcstat
zilstat
dbufstat
mount.zfs
zed
zgenhostid
zstream
zfs_ids_to_path
zpool_influxdb'
export ZFSTEST_FILES_COMMON='badsend
btree_test
chg_usr_exec
clonefile
clone_after_trunc
clone_mmap_cached
clone_mmap_write
crypto_test
devname2devid
dir_rd_update
draid
file_fadvise
file_append
file_check
file_trunc
file_write
get_diff
getversion
largest_file
libzfs_input_check
manipulate_user_buffer
mkbusy
mkfile
mkfiles
mktree
mmap_exec
mmap_ftruncate
mmap_libaio
mmap_seek
mmap_sync
mmapwrite
mmap_write_sync
nvlist_to_lua
randfree_file
randwritecomp
readmmap
read_dos_attributes
renameat2
rename_dir
rm_lnkcnt_zero_file
send_doall
statx
threadsappend
user_ns_exec
write_dos_attributes
xattrtest
stride_dd
zed_fd_spill-zedlet
suid_write_to_file
cp_files
blake3_test
edonr_test
skein_test
sha2_test
ctime
truncate_test
ereports
zfs_diff-socket
dosmode_readonly_write
idmap_util'
export ZFSTEST_FILES_LINUX='
setlease'