mirror_zfs/include/os/freebsd/zfs/sys
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
..
freebsd_crypto.h Extending FreeBSD UIO Struct 2021-01-20 21:27:30 -08:00
Makefile.am Share zfs_fsync, zfs_read, zfs_write, et al between Linux and FreeBSD 2020-10-21 14:08:06 -07:00
sha2.h Changes to make openzfs build within FreeBSD buildworld 2020-07-31 21:30:31 -07:00
vdev_os.h Add prototypes 2020-06-18 12:21:32 -07:00
zfs_bootenv_os.h zfs label bootenv should store data as nvlist 2020-09-15 15:42:27 -07:00
zfs_context_os.h Detect HAVE_LARGE_STACKS at compile time 2021-07-16 14:28:55 -06:00
zfs_ctldir.h Throw const on some strings 2020-10-02 17:44:10 -07:00
zfs_dir.h Throw const on some strings 2020-10-02 17:44:10 -07:00
zfs_ioctl_compat.h Simplify and document OpenZFS library dependencies 2021-10-07 11:31:26 -06:00
zfs_vfsops_os.h Remove unimplemented virus scanning hooks 2021-05-10 22:02:25 -07:00
zfs_vnops_os.h Share zfs_fsync, zfs_read, zfs_write, et al between Linux and FreeBSD 2020-10-21 14:08:06 -07:00
zfs_znode_impl.h Fix lseek(SEEK_DATA/SEEK_HOLE) mmap consistency 2021-11-07 14:27:44 -07:00
zpl.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00