If compressed length is zero, return a zero-filled block.

MFC after: 1 week
This commit is contained in:
Hidetoshi Shimokawa 2007-04-24 06:30:06 +00:00
parent 8f30c4da04
commit 33018fbdff

View File

@ -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;