]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r271536: MFV r271518:
authordelphij <delphij@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 25 Sep 2014 21:28:19 +0000 (21:28 +0000)
committerdelphij <delphij@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 25 Sep 2014 21:28:19 +0000 (21:28 +0000)
commit5219466f5f58318ad184b7da0f8ade7c2a3e0f61
treec1a95b8aa425da4d38384c90118d780e602353aa
parent1ba1017b3587ccaf3dee0f610eca28f27bcc71ba
MFC r271536: MFV r271518:

Correctly report hole at end of file.

When asked to find a hole, the DMU sees that there are no holes in the
object, and returns ESRCH.  The ZPL interprets this as "no holes before
the end of the file", and therefore inserts the "virtual hole" at the
end of the file.  Because DMU and ZPL have different ideas of where the
end of an object/file is, we will end up returning the end of file,
which is generally larger, instead of returning the end of object.

The fix is to handle the "virtual hole" in the DMU. If no hole is found,
the DMU will return a hole at the end of the file, rather than an error.

Illumos issue:
    5139 SEEK_HOLE failed to report a hole at end of file

Approved by: re (gjb)

git-svn-id: svn://svn.freebsd.org/base/stable/10@272134 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c