mirror_zfs/tests/zfs-tests/cmd
Brian Behlendorf de198f2d95
Fix lseek(SEEK_DATA/SEEK_HOLE) mmap consistency
When using lseek(2) to report data/holes memory mapped regions of
the file were ignored.  This could result in incorrect results.
To handle this zfs_holey_common() was updated to asynchronously
writeback any dirty mmap(2) regions prior to reporting holes.

Additionally, while not strictly required, the dn_struct_rwlock is
now held over the dirty check to prevent the dnode structure from
changing.  This ensures that a clean dnode can't be dirtied before
the data/hole is located.  The range lock is now also taken to
ensure the call cannot race with zfs_write().

Furthermore, the code was refactored to provide a dnode_is_dirty()
helper function which checks the dnode for any dirty records to
determine its dirtiness.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #11900
Closes #12724
2021-11-07 14:27:44 -07:00
..
badsend Drop references when skipping dmu_send due to EXDEV 2020-09-30 13:19:49 -07:00
btree_test Use the correct return type for getopt 2020-12-17 10:19:30 -08:00
chg_usr_exec
devname2devid ZTS: Fix devname2devid build on FreeBSD with libudev 2020-07-22 10:49:22 -07:00
dir_rd_update
draid Fix various typos 2021-04-02 18:52:15 -07:00
file_check tests/file_check: remove unused variable 2021-06-07 20:59:01 -07:00
file_trunc
file_write Fix various typos 2021-04-02 18:52:15 -07:00
get_diff
largest_file
libzfs_input_check Simplify and document OpenZFS library dependencies 2021-10-07 11:31:26 -06:00
mkbusy Simplify and document OpenZFS library dependencies 2021-10-07 11:31:26 -06:00
mkfile Prune /*NOTREACHED*/ 2021-07-26 12:07:26 -07:00
mkfiles
mktree
mmap_exec
mmap_libaio
mmap_seek Fix lseek(SEEK_DATA/SEEK_HOLE) mmap consistency 2021-11-07 14:27:44 -07:00
mmapwrite Prune /*NOTREACHED*/ 2021-07-26 12:07:26 -07:00
nvlist_to_lua Use abs_top_builddir when referencing libraries 2020-07-10 14:26:32 -07:00
randfree_file
randwritecomp
readmmap
rename_dir
rm_lnkcnt_zero_file
send_doall send_iterate_snap : doall send without fromsnap 2021-02-24 09:48:58 -08:00
stride_dd
threadsappend
user_ns_exec
xattrtest Don't abuse vfork() 2021-05-21 10:16:06 -07:00
file_common.h
Makefile.am Fix lseek(SEEK_DATA/SEEK_HOLE) mmap consistency 2021-11-07 14:27:44 -07:00