]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit - sys/pc98/pc98/machdep.c
MFV r271518:
authorXin LI <delphij@FreeBSD.org>
Sat, 13 Sep 2014 17:48:44 +0000 (17:48 +0000)
committerXin LI <delphij@FreeBSD.org>
Sat, 13 Sep 2014 17:48:44 +0000 (17:48 +0000)
commitf9290bc2c9250844381e43dc172c30add1878952
tree7a7ad3137445f3306fc683c5164ee2276f1fc752
parent3a8b58047f1f0ae7aed6a78a0715b05e875d14a7
parentf88b4b535d2c71adcbcb5b111ccb3d8f51a24811
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

MFC after: 1 week
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c