diff options
author | simokawa <simokawa@FreeBSD.org> | 2007-04-24 06:30:06 +0000 |
---|---|---|
committer | simokawa <simokawa@FreeBSD.org> | 2007-04-24 06:30:06 +0000 |
commit | 172f73729f77706d0310155e6f6fe63d849d5443 (patch) | |
tree | 8d2d04b222dac6af2565529aebb4eb3d2dd8d41c /sys/geom/uzip | |
parent | 8b888b32a2afda86587c0b5018f0675fb7998f91 (diff) | |
download | FreeBSD-src-172f73729f77706d0310155e6f6fe63d849d5443.zip FreeBSD-src-172f73729f77706d0310155e6f6fe63d849d5443.tar.gz |
If compressed length is zero, return a zero-filled block.
MFC after: 1 week
Diffstat (limited to 'sys/geom/uzip')
-rw-r--r-- | sys/geom/uzip/g_uzip.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/geom/uzip/g_uzip.c b/sys/geom/uzip/g_uzip.c index f05978e..99d7c22 100644 --- a/sys/geom/uzip/g_uzip.c +++ b/sys/geom/uzip/g_uzip.c @@ -162,6 +162,13 @@ g_uzip_done(struct bio *bp) ulen = MIN(sc->blksz - uoff, bp2->bio_length - upos); len = sc->offsets[i + 1] - sc->offsets[i]; + if (len == 0) { + /* All zero block: no cache update */ + bzero(bp2->bio_data + upos, ulen); + upos += ulen; + bp2->bio_completed += ulen; + continue; + } zs.next_in = bp->bio_data + pos; zs.avail_in = len; zs.next_out = sc->last_buf; |