]> git.proxmox.com Git - mirror_zfs.git/commit - include/sys/dnode.h
OpenZFS 7176 - Yet another hole birth issue
authorPaul Dagnelie <pcd@delphix.com>
Tue, 9 Aug 2016 21:06:39 +0000 (23:06 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 18 Aug 2016 16:26:44 +0000 (09:26 -0700)
commit32d41fb73a0d04a1d864e7602595b4c6e0d16c10
treebb9f2da2d43f37a1f1a4e850198ff6e6b252af50
parent8658115c19f84b30d68402c32a33a2157c97e4f1
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
include/sys/dnode.h
module/zfs/dbuf.c