zfs/module
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
..
avl Links in Source Files 2020-09-03 16:17:18 -07:00
icp Extending FreeBSD UIO Struct 2021-11-12 16:31:55 -08:00
lua Use fallthrough macro 2021-11-12 15:24:36 -08:00
nvpair Update `checkstyle` workflow env to ubuntu-20.04 2021-11-12 16:31:55 -08:00
os Linux 5.16 compat: submit_bio() 2021-11-12 16:31:55 -08:00
spl Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
unicode Update `checkstyle` workflow env to ubuntu-20.04 2021-11-12 16:31:55 -08:00
zcommon Fix AVX512BW Fletcher code on AVX512-but-not-BW machines 2021-06-23 13:22:14 -07:00
zfs Fix lseek(SEEK_DATA/SEEK_HOLE) mmap consistency 2021-11-12 16:31:55 -08:00
zstd Fix cross-endian interoperability of zstd 2021-11-12 15:24:36 -08:00
.gitignore Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
Kbuild.in Add zstd support to zfs 2020-08-20 10:30:06 -07:00
Makefile.bsd Restore FreeBSD resource usage accounting 2021-03-05 12:50:32 -08:00
Makefile.in Update `checkstyle` workflow env to ubuntu-20.04 2021-11-12 16:31:55 -08:00