Date: Thu, 7 Oct 2010 00:30:30 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r213504 - stable/7/usr.bin/gzip Message-ID: <201010070030.o970UUJA023053@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Thu Oct 7 00:30:29 2010 New Revision: 213504 URL: http://svn.freebsd.org/changeset/base/213504 Log: MFC r210344: In the past gunzip(1) write()'s after each inflate return. This is not optimal from a performance standpoint since the write buffer is not necessarily be filled up when the inflate rountine reached the end of input buffer and it's not the end of file. This problem gets uncovered by trying to pipe gunzip -c output to a GEOM device directly, which enforces the writes be multiple of sector size. Sponsored by: iXsystems, Inc. Reported by: jpaetzel Modified: stable/7/usr.bin/gzip/gzip.c Directory Properties: stable/7/usr.bin/gzip/ (props changed) Modified: stable/7/usr.bin/gzip/gzip.c ============================================================================== --- stable/7/usr.bin/gzip/gzip.c Thu Oct 7 00:29:07 2010 (r213503) +++ stable/7/usr.bin/gzip/gzip.c Thu Oct 7 00:30:29 2010 (r213504) @@ -920,6 +920,8 @@ gz_uncompress(int in, int out, char *pre switch (error) { /* Z_BUF_ERROR goes with Z_FINISH... */ case Z_BUF_ERROR: + if (z.avail_out > 0 && !done_reading) + continue; case Z_STREAM_END: case Z_OK: break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010070030.o970UUJA023053>