Page MenuHomeFreeBSD

geom_uzip to update zlib version 1.0.4 to 1.2.11.
ClosedPublic

Authored by delphij on May 16 2019, 4:13 AM.

Details

Summary

Update geom_uzip to use newer zlib version.

This change depends on D20193 and D19706.
Based on a new proposal, this also depends on D21156.

Cross reference :
https://reviews.freebsd.org/D19706?id=55444#inline-120590

Test Plan

% kldload geom_uzip
% mdconfig -a -t vnode -f <uzip-file>
% mount -r /dev/md#.uzip /mnt/<path>

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 25638
Build 24231: arc lint + arc unit

Event Timeline

Harbormaster completed remote builds in B24253: Diff 57432.
ota_j.email.ne.jp edited the summary of this revision. (Show Details)May 16 2019, 4:17 AM
ota_j.email.ne.jp added a reviewer: sobomax.
sobomax accepted this revision.Jun 5 2019, 5:15 AM

Looks good, as long as it compiles.

This revision is now accepted and ready to land.Jun 5 2019, 5:15 AM

Thank you for taking a look.

This change-set requires 2 other change-sets, crc32 relocation and dual zlib compilation before ready to land.

I actually didn't expect this is marked as "Buildable 24253"....

delphij requested changes to this revision.Jul 31 2019, 5:43 PM
delphij added inline comments.
sys/geom/uzip/g_uzip_zlib.c
114

I think inflateInit() still expects zfree be set?

This revision now requires changes to proceed.Jul 31 2019, 5:43 PM
sys/geom/uzip/g_uzip_zlib.c
110

compressBounce is taken out by -DZ_SOLO.
We will need to adjust zlib side to expose with -DZ_SOLO.

114

I will check. Using -DZ_SOLO changes implementation and don't recall.

Given we added -DZ_SOLO to zlib, pass zfree function explicitly.
Expose compressBound() function even with -DZ_SOLO.
compress2() doesn't work with -DZ_SOLO and not worth exposing as is.
Alternative is improve MY_ZCALLOC conditions along with Z_SOLO for compress2 to work as well.

Enhancce MY_ZCALLOC to expose functions in compress.c.
This also allows to use default zfree.

Expose functions from compress.c with modified MY_ZCALLC handling.

ota_j.email.ne.jp retitled this revision from geom_uzip to update zlib version 1.0.4 to 1.2.11. to Expose functions from compress.c and geom_uzip to update zlib version 1.0.4 to 1.2.11..Aug 3 2019, 12:36 AM
ota_j.email.ne.jp retitled this revision from Expose functions from compress.c and geom_uzip to update zlib version 1.0.4 to 1.2.11. to geom_uzip to update zlib version 1.0.4 to 1.2.11..Aug 4 2019, 3:37 PM
ota_j.email.ne.jp edited the summary of this revision. (Show Details)
delphij commandeered this revision.Aug 7 2019, 1:45 AM
delphij edited reviewers, added: ota_j.email.ne.jp; removed: delphij.
delphij updated this revision to Diff 60529.Aug 7 2019, 1:45 AM

Rebase over D21156.

sys/geom/uzip/g_uzip_zlib.c
113

Given geom_uzip uses nowait kmalloc,

	zp->zs.zalloc = zcalloc_nowait;

is the equivalent choice.

I am not sure which one provides better system handling and user experiences, though.

It will be nice if we can get file-system and kernel memory experts inputs.

135

geom_uzip uses M_NOWAIT option.

delphij marked 2 inline comments as done.Aug 7 2019, 4:39 AM
delphij added inline comments.
sys/geom/uzip/g_uzip_zlib.c
113

My version of zcalloc was the nowait variant :)

delphij updated this revision to Diff 60567.Aug 8 2019, 6:20 AM
delphij marked an inline comment as done.

Properly initialize zstream structure.

delphij accepted this revision.Aug 8 2019, 6:23 AM
This revision is now accepted and ready to land.Aug 8 2019, 6:23 AM
This revision was automatically updated to reflect the committed changes.
sys/geom/uzip/g_uzip_zlib.c
113

Yes, that was the case.
I somehow got confused and mixed up.