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
F81569279: D20271.id60567.diff
Thu, Apr 18, 6:02 AM
Unknown Object (File)
Sat, Apr 13, 11:37 PM
Unknown Object (File)
Sat, Apr 13, 11:35 PM
Unknown Object (File)
Sat, Apr 13, 11:35 PM
Unknown Object (File)
Fri, Apr 12, 1:41 PM
Unknown Object (File)
Tue, Apr 9, 4:38 PM
Unknown Object (File)
Thu, Mar 28, 9:09 PM
Unknown Object (File)
Wed, Mar 20, 5: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 - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25635
Build 24228: 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
111

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.