mirror_zfs/tests/zfs-tests/include
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
..
.gitignore Add zpool events tests 2017-05-22 12:34:42 -04:00
blkdev.shlib ZTS: Minimize udev_wait in zvol_misc tests 2021-10-01 09:36:02 -06:00
commands.cfg Fix lseek(SEEK_DATA/SEEK_HOLE) mmap consistency 2021-11-07 14:27:44 -07:00
default.cfg.in Add "compatibility" property for zpool feature sets 2021-02-17 21:30:45 -08:00
libtest.shlib ZTS: Enable punch-hole tests on FreeBSD 2021-08-30 13:33:32 -07:00
Makefile.am Centralize variable substitution 2020-07-14 17:33:44 -07:00
math.shlib ZTS: Make bc conditional use compatible with new BSD bc 2020-07-09 17:49:02 -07:00
properties.shlib Add zstd support to zfs 2020-08-20 10:30:06 -07:00
tunables.cfg Fix lseek(SEEK_DATA/SEEK_HOLE) mmap consistency 2021-11-07 14:27:44 -07:00
zpool_script.shlib zfs-tests: fix warnings when packaging some .shlib files 2019-05-24 14:12:14 -07:00