mirror_zfs/module/zfs
Paul Dagnelie 32d41fb73a OpenZFS 7176 - Yet another hole birth issue
This is another bug in the long line of hole-birth related issues. In
this particular case, it was discovered that a previous hole-birth fix
(illumos bug 6513, commit bc77ba73) did not cover as many cases as we
thought it did. While the issue worked in the case of hole-punching
(writing zeroes to a large part of a file), it did not deal with
truncation, and then writing beyond the new end of the file.

The problem is that dbuf_findbp will return ENOENT if the block it's
trying to find is beyond the end of the file. If that happens, we assume
there is no birth time, and so we lose that information when we write
out new blkptrs. We should teach dbuf_findbp to look for things that are
beyond the current end, but not beyond the absolute end of the file.

Authored by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens mahrens@delphix.com
Reviewed by: George Wilson george.wilson@delphix.com
Ported-by: kernelOfTruth <kerneloftruth@gmail.com>
Signed-off-by: Boris Protopopov <boris.protopopov@actifio.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

OpenZFS-issue: https://www.illumos.org/issues/7176
OpenZFS-commit: https://github.com/openzfs/openzfs/pull/173/commits/8b9f3ad
Upstream-bugs: DLPX-46009

Porting notes:
- Fix ISO C90 mixed declaration error in dbuf.c ( int nlevels, epbs; ) ;
  keep previous position of the initialization
2016-08-18 09:26:44 -07:00
..
arc.c arc_meta_limit should be updated when arc_max is changed. 2016-08-02 13:43:36 -07:00
blkptr.c
bplist.c
bpobj.c
bptree.c
bqueue.c
dbuf_stats.c Fix dbuf_stats_hash_table_data race 2016-07-14 16:25:04 -07:00
dbuf.c OpenZFS 7176 - Yet another hole birth issue 2016-08-18 09:26:44 -07:00
ddt_zap.c
ddt.c
dmu_diff.c
dmu_object.c Implement large_dnode pool feature 2016-06-24 13:13:21 -07:00
dmu_objset.c OpenZFS 6314 - buffer overflow in dsl_dataset_name 2016-06-28 13:47:03 -07:00
dmu_send.c OpenZFS 6314 - buffer overflow in dsl_dataset_name 2016-06-28 13:47:03 -07:00
dmu_traverse.c Add tunable to ignore hole_birth 2016-08-15 09:52:56 -07:00
dmu_tx.c Implement large_dnode pool feature 2016-06-24 13:13:21 -07:00
dmu_zfetch.c
dmu.c Implement large_dnode pool feature 2016-06-24 13:13:21 -07:00
dnode_sync.c Implement large_dnode pool feature 2016-06-24 13:13:21 -07:00
dnode.c Limit the amount of dnode metadata in the ARC 2016-07-25 15:26:38 -07:00
dsl_bookmark.c OpenZFS 6314 - buffer overflow in dsl_dataset_name 2016-06-28 13:47:03 -07:00
dsl_dataset.c Rework of fletcher_4 module 2016-08-16 14:11:55 -07:00
dsl_deadlist.c
dsl_deleg.c OpenZFS 6314 - buffer overflow in dsl_dataset_name 2016-06-28 13:47:03 -07:00
dsl_destroy.c OpenZFS 2605, 6980, 6902 2016-06-28 13:47:02 -07:00
dsl_dir.c OpenZFS 6314 - buffer overflow in dsl_dataset_name 2016-06-28 13:47:03 -07:00
dsl_pool.c
dsl_prop.c OpenZFS 6314 - buffer overflow in dsl_dataset_name 2016-06-28 13:47:03 -07:00
dsl_scan.c OpenZFS 5997 - FRU field not set during pool creation and never updated 2016-08-12 13:06:48 -07:00
dsl_synctask.c
dsl_userhold.c OpenZFS 6314 - buffer overflow in dsl_dataset_name 2016-06-28 13:47:03 -07:00
fm.c Fix indefinite article 2016-08-11 11:23:49 -07:00
gzip.c
lz4.c
lzjb.c
Makefile.in Add RAID-Z routines for SSE2 instruction set, in x86_64 mode. 2016-07-13 10:24:55 -07:00
metaslab.c Fix gcc self-comparison warning 2016-08-02 13:14:18 -07:00
multilist.c
pathname.c
policy.c
range_tree.c
refcount.c
rrwlock.c
sa.c Implement large_dnode pool feature 2016-06-24 13:13:21 -07:00
sha256.c
spa_boot.c
spa_config.c OpenZFS 5997 - FRU field not set during pool creation and never updated 2016-08-12 13:06:48 -07:00
spa_errlog.c
spa_history.c Fix indefinite article 2016-08-11 11:23:49 -07:00
spa_misc.c Implement large_dnode pool feature 2016-06-24 13:13:21 -07:00
spa_stats.c
spa.c OpenZFS 5997 - FRU field not set during pool creation and never updated 2016-08-12 13:06:48 -07:00
space_map.c
space_reftree.c
trace.c
txg.c txg visibility code should not execute under tc_open_lock 2016-07-27 14:11:13 -07:00
uberblock.c
unique.c
vdev_cache.c
vdev_disk.c Remove custom root pool import code 2016-08-11 11:19:34 -07:00
vdev_file.c
vdev_label.c
vdev_mirror.c
vdev_missing.c
vdev_queue.c
vdev_raidz_math_avx2.c Fixes and enhancements of SIMD raidz parity 2016-07-19 16:43:07 -07:00
vdev_raidz_math_impl.h
vdev_raidz_math_scalar.c Fixes and enhancements of SIMD raidz parity 2016-07-19 16:43:07 -07:00
vdev_raidz_math_sse2.c Add RAID-Z routines for SSE2 instruction set, in x86_64 mode. 2016-07-13 10:24:55 -07:00
vdev_raidz_math_ssse3.c Fixes and enhancements of SIMD raidz parity 2016-07-19 16:43:07 -07:00
vdev_raidz_math.c RAIDZ parity kstat rework 2016-07-19 16:43:07 -07:00
vdev_raidz.c Build user-space with different gcc optimization levels 2016-08-09 14:40:35 -07:00
vdev_root.c
vdev.c Fix incorrect pool state after import 2016-08-12 13:46:51 -07:00
zap_leaf.c
zap_micro.c Implement large_dnode pool feature 2016-06-24 13:13:21 -07:00
zap.c Implement large_dnode pool feature 2016-06-24 13:13:21 -07:00
zfeature_common.c Implement large_dnode pool feature 2016-06-24 13:13:21 -07:00
zfeature.c
zfs_acl.c Fix interaction between userns uid/gid and SA 2016-08-08 10:47:43 -07:00
zfs_byteswap.c
zfs_ctldir.c Remove znode's z_uid/z_gid member 2016-07-25 13:21:49 -07:00
zfs_debug.c
zfs_dir.c Remove znode's z_uid/z_gid member 2016-07-25 13:21:49 -07:00
zfs_fm.c OpenZFS 5997 - FRU field not set during pool creation and never updated 2016-08-12 13:06:48 -07:00
zfs_fuid.c Remove znode's z_uid/z_gid member 2016-07-25 13:21:49 -07:00
zfs_ioctl.c Fix zfs_allow_log_destroy() NULL dereference 2016-07-29 15:34:12 -07:00
zfs_log.c Remove znode's z_uid/z_gid member 2016-07-25 13:21:49 -07:00
zfs_onexit.c
zfs_replay.c Implement large_dnode pool feature 2016-06-24 13:13:21 -07:00
zfs_rlock.c
zfs_sa.c Use native inode->i_nlink instead of znode->z_links 2016-07-14 16:25:34 -07:00
zfs_vfsops.c Remove znode's z_uid/z_gid member 2016-07-25 13:21:49 -07:00
zfs_vnops.c Fix interaction between userns uid/gid and SA 2016-08-08 10:47:43 -07:00
zfs_znode.c Move assignment of i_blkbits field 2016-07-29 15:34:12 -07:00
zil.c OpenZFS 6314 - buffer overflow in dsl_dataset_name 2016-06-28 13:47:03 -07:00
zio_checksum.c
zio_compress.c
zio_inject.c
zio.c Fix zdb crash with 4K-only devices 2016-07-27 13:38:46 -07:00
zle.c
zpl_ctldir.c Use file_dentry and file_inode wrappers 2016-08-11 12:06:37 -07:00
zpl_export.c
zpl_file.c Use file_dentry and file_inode wrappers 2016-08-11 12:06:37 -07:00
zpl_inode.c OpenZFS 6314 - buffer overflow in dsl_dataset_name 2016-06-28 13:47:03 -07:00
zpl_super.c
zpl_xattr.c Linux 4.7 compat: fix zpl_get_acl returns invalid acl pointer 2016-08-09 10:03:04 -07:00
zrlock.c
zvol.c Linux 4.8 compat: Fix removal of bio->bi_rw member 2016-08-11 11:19:34 -07:00