mirror_zfs/include/os/linux/zfs/sys
Brian Behlendorf 664d487a5d 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-05 08:08:55 -07:00
..
Makefile.am Share zfs_fsync, zfs_read, zfs_write, et al between Linux and FreeBSD 2020-10-21 14:08:06 -07:00
policy.h Share zfs_fsync, zfs_read, zfs_write, et al between Linux and FreeBSD 2020-10-21 14:08:06 -07:00
sha2.h
trace_acl.h G/C struct znode -> z_moved 2020-11-10 12:42:47 -08:00
trace_arc.h Fix/improve dbuf hits accounting 2021-09-14 14:31:22 -07:00
trace_common.h
trace_dbgmsg.h
trace_dbuf.h
trace_dmu.h
trace_dnode.h
trace_multilist.h
trace_rrwlock.h
trace_txg.h
trace_vdev.h
trace_zfs.h
trace_zil.h
trace_zio.h
trace_zrlock.h
zfs_bootenv_os.h zfs label bootenv should store data as nvlist 2020-09-15 15:42:27 -07:00
zfs_context_os.h Use fallthrough macro 2021-11-02 09:50:30 -07:00
zfs_ctldir.h Throw const on some strings 2020-10-02 17:44:10 -07:00
zfs_dir.h
zfs_vfsops_os.h Macroify teardown lock handling 2021-03-12 15:51:39 -08:00
zfs_vnops_os.h Linux 5.12 compat: idmapped mounts 2021-03-19 21:00:59 -07:00
zfs_znode_impl.h Fix lseek(SEEK_DATA/SEEK_HOLE) mmap consistency 2021-11-05 08:08:55 -07:00
zpl.h Linux 5.15 compat: get_acl() 2021-09-14 15:42:59 -07:00