]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Reorganize the handling all-zeroes terminal block in sparse mode
authorthomas <thomas@FreeBSD.org>
Thu, 18 Feb 2016 08:44:16 +0000 (08:44 +0000)
committerthomas <thomas@FreeBSD.org>
Thu, 18 Feb 2016 08:44:16 +0000 (08:44 +0000)
commit3b2148e2997b381131bff3e262e5d3b4754fed50
tree3573aca88477cbb3596f847adddab1ca8a6f258e
parent1d033f316cb6507343722bb7b0d069b0a6062613
Reorganize the handling all-zeroes terminal block in sparse mode

The intent of the previous code in that case was to force
an explicit write, but the implementation was incorrect, and
as a result the write was never performed. This new implementation
instead uses ftruncate(2) to extend the file with a trailing hole.

Also introduce regression tests for these cases.

PR: 189284
(original PR whose fix introduced this bug)

PR: 207092

Differential Revision: D5248
Reviewed by: sobomax,kib
MFC after: 2 weeks
bin/dd/Makefile
bin/dd/dd.c
bin/dd/dd.h
bin/dd/gen.c
bin/dd/ref.obs_zeroes [new file with mode: 0644]