mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-02 08:42:48 +00:00
If compressed length is zero, return a zero-filled block.
MFC after: 1 week
This commit is contained in:
parent
8f30c4da04
commit
33018fbdff
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=168999
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user