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.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 2:42 PM
Unknown Object (File)
Thu, Nov 14, 8:52 AM
Unknown Object (File)
Wed, Nov 13, 5:49 PM
Unknown Object (File)
Wed, Nov 6, 3:54 PM
Unknown Object (File)
Tue, Nov 5, 3:30 PM
Unknown Object (File)
Tue, Oct 29, 2:23 AM
Unknown Object (File)
Tue, Oct 22, 11:05 AM
Unknown Object (File)
Tue, Oct 22, 11:05 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 - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25715
Build 24298: arc lint + arc unit

Event Timeline

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
109

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 edited reviewers, added: ota_j.email.ne.jp; removed: delphij.
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 added inline comments.
sys/geom/uzip/g_uzip_zlib.c
113

My version of zcalloc was the nowait variant :)

delphij marked an inline comment as done.

Properly initialize zstream structure.

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.