zfs/include
Brian Behlendorf a524f8d6af 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-12 16:31:55 -08:00
..
os Fix lseek(SEEK_DATA/SEEK_HOLE) mmap consistency 2021-11-12 16:31:55 -08:00
sys Fix lseek(SEEK_DATA/SEEK_HOLE) mmap consistency 2021-11-12 16:31:55 -08:00
.gitignore OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
Makefile.am zfs label bootenv should store data as nvlist 2020-09-15 18:36:12 -07:00
cityhash.h Compile cityhash code into libzfs 2020-03-27 09:11:22 -07:00
libnvpair.h Add JSON output support to channel programs 2018-03-19 12:40:58 -07:00
libuutil.h Correct cppcheck errors 2017-09-19 12:17:29 -07:00
libuutil_common.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
libuutil_impl.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
libzfs.h zpool: correctly align columns with -p 2020-11-17 12:20:01 -08:00
libzfs_core.h zfs label bootenv should store data as nvlist 2020-09-15 18:36:12 -07:00
libzfs_impl.h Add 'zfs rename -u' to rename without remounting 2020-09-03 16:16:15 -07:00
libzfsbootenv.h zfs label bootenv should store data as nvlist 2020-09-15 18:36:12 -07:00
libzutil.h Rescan enclosure sysfs path on import 2021-11-12 16:31:55 -08:00
thread_pool.h Add libtpool (thread pools) 2017-08-09 15:31:08 -07:00
zfeature_common.h Add zstd support to zfs 2020-08-20 10:30:06 -07:00
zfs_comutil.h Fix "zpool add -n" for dedup, special and log devices 2020-01-06 15:40:06 -08:00
zfs_deleg.h Remove code for zfs remap 2019-06-24 16:44:01 -07:00
zfs_fletcher.h Add AVX512BW variant of fletcher 2019-10-30 12:26:14 -07:00
zfs_namecheck.h Implement bookmark copying 2020-02-11 13:19:12 -08:00
zfs_prop.h Add zfs module feature and property info to sysfs 2018-09-02 12:09:53 -07:00