History log of /freebsd-10-stable/sys/geom/uzip/g_uzip.c
Revision Date Author Comments
# 343605 31-Jan-2019 avos

MFC r343473:
geom_uzip(4): move NULL pointer KASSERT check before it is dereferenced

PR: 203499
Submitted by: <chadf@triularity.org>

MFC r343475:
geom_uzip(4): set 'gp != NULL' assertion on top of the function

There was yet another access to this variable in g_trace() few
lines upper.

PR: 203499
Reported by: cem


# 303167 21-Jul-2016 sobomax

MFC: merge in all new features and improvements into geom_uzip(8) from current,
which includes:

o LZMA compression;
o block de-duplication;
o performance improvements;
o pop out worker kthread to do extraction.

This includes the following revisions:
r295943,r295952,r298502,r298619,r299195,r302284

Suggested by: emaste


# 289952 25-Oct-2015 ngie

MFC r286367:

Make some debug printf's into DPRINTF's to reduce noise on attach/detach

Differential Revision: https://reviews.freebsd.org/D3306
Reviewed by: loos
Sponsored by: EMC / Isilon Storage Division


# 269456 03-Aug-2014 marcel

MFC 268986; fix file system corruption by creating as many BIOs as needed
to satisfy the original request -- in other words: no short reads.

Obtained from: Juniper Networks, Inc.


# 266220 16-May-2014 loos

MFC r260522, r260523, r261439, r261440, r261586, r264504, r264769, r265193,
r265194, r265197

r260522:
Add the manual page for geom_uncompress(4).

r260523:
Build the geom_uncompress(4) module by default.

Fix geom_uncompress(4) module loading. Don't link zlib.c (which is a module
itself) directly.

r261439:
Remove some unnecessary code. The offsets read from the first block are
overwritten a few lines bellow.

r261440:
Fix a logic error. Because of this inflateReset() wasn't being called and
the output buffer wasn't being cleared between the inflate() calls,
producing zeroed output after the first inflate() call.

This fixes the read of mkuzip(8) images with geom_uncompress(4).

r261586:
Fix the build with DEBUG enabled. Where possible, fix style(9) issues.

r264504:
Make sure not to do I/O for more than MAXPHYS bytes. Doing so can cause
problems in our providers, such as a KASSERT in md(4). We can initiate
I/O for more than MAXPHYS bytes if we've been given a BIO for MAXPHYS
bytes, the blocks from which we're reading couldn't be compressed and
we had compression in preceeding blocks resulting in misalignment of
the blocks we're trying to read relative to the sector. We're forced to
round up the I/O length to make it an multiple of the sector size.

When we detect the condition, we'll reduce the block count and perform
a "short" read. In g_uzip_done() we need to consider the original I/O
length and stop early if we're about to deflate a block that we didn't
read. By using bio_completed in the cloned BIO and not bio_length to
check for this, we automatically and gracefully handle short reads that
our providers may be doing on top of the short reads we may initiate
ourselves.

r264769:
Keep geom_uncompress(4) in line with geom_uzip(4), bring in the r264504 fix.

Make sure not to start I/O bigger than MAXPHYS bytes.

r265193:
Some style and whitespace fixes. Reduce the difference between geom_uzip(4)
and geom_uncompress(4). Now, they produce an almost clean diff(1) output.

Remove a duplicated variable from g_uncompress.c and an unnecessary header
from g_uzip.c.

r265194:
Actually the FEATURE() macro is defined on sys/sysctl.h.

r265197:
Fix a leak in g_uzip_taste(). After retrieve all the block offsets from
the uzip image, free the last data read.


# 269456 03-Aug-2014 marcel

MFC 268986; fix file system corruption by creating as many BIOs as needed
to satisfy the original request -- in other words: no short reads.

Obtained from: Juniper Networks, Inc.


# 266220 16-May-2014 loos

MFC r260522, r260523, r261439, r261440, r261586, r264504, r264769, r265193,
r265194, r265197

r260522:
Add the manual page for geom_uncompress(4).

r260523:
Build the geom_uncompress(4) module by default.

Fix geom_uncompress(4) module loading. Don't link zlib.c (which is a module
itself) directly.

r261439:
Remove some unnecessary code. The offsets read from the first block are
overwritten a few lines bellow.

r261440:
Fix a logic error. Because of this inflateReset() wasn't being called and
the output buffer wasn't being cleared between the inflate() calls,
producing zeroed output after the first inflate() call.

This fixes the read of mkuzip(8) images with geom_uncompress(4).

r261586:
Fix the build with DEBUG enabled. Where possible, fix style(9) issues.

r264504:
Make sure not to do I/O for more than MAXPHYS bytes. Doing so can cause
problems in our providers, such as a KASSERT in md(4). We can initiate
I/O for more than MAXPHYS bytes if we've been given a BIO for MAXPHYS
bytes, the blocks from which we're reading couldn't be compressed and
we had compression in preceeding blocks resulting in misalignment of
the blocks we're trying to read relative to the sector. We're forced to
round up the I/O length to make it an multiple of the sector size.

When we detect the condition, we'll reduce the block count and perform
a "short" read. In g_uzip_done() we need to consider the original I/O
length and stop early if we're about to deflate a block that we didn't
read. By using bio_completed in the cloned BIO and not bio_length to
check for this, we automatically and gracefully handle short reads that
our providers may be doing on top of the short reads we may initiate
ourselves.

r264769:
Keep geom_uncompress(4) in line with geom_uzip(4), bring in the r264504 fix.

Make sure not to start I/O bigger than MAXPHYS bytes.

r265193:
Some style and whitespace fixes. Reduce the difference between geom_uzip(4)
and geom_uncompress(4). Now, they produce an almost clean diff(1) output.

Remove a duplicated variable from g_uncompress.c and an unnecessary header
from g_uzip.c.

r265194:
Actually the FEATURE() macro is defined on sys/sysctl.h.

r265197:
Fix a leak in g_uzip_taste(). After retrieve all the block offsets from
the uzip image, free the last data read.