public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* mkfs.jffs2 failing to use zlib to compress things
@ 2002-07-22 16:25 Stewart Brodie
  2002-07-30 22:48 ` David Woodhouse
  0 siblings, 1 reply; 2+ messages in thread
From: Stewart Brodie @ 2002-07-22 16:25 UTC (permalink / raw)
  To: linux-mtd

I have been having problems with mkfs.jffs2 (with the fs/jffs2 files from a
MIPS Linux 2.4.17 kernel) not compressing files as it constructs the
filesystem image.  I have no idea whether this will affect the run-time
behaviour or not - I've not got that far.  After inserting debugging into the
compression routines, it appears that Z_STREAM_ERROR streaming errors are
occurring when the data is being passed through zlib, and thus the simple
rtime compression is being used instead.

It looks like mkfs.jffs2 is driving zlib's compression routines in a bizarre
way (c.f. the decompression which uses a trivial loop) passing only small
blocks of data at a time.  Is that loop correct?  Why is Z_PARTIAL_FLUSH
being used?  The errors I get are all "final deflate returned -2".

Any ideas what might be causing this?


[originally posted to the MIPS Linux kernel mailing list by mistake]

-- 
Stewart Brodie, Senior Software Engineer
Pace Micro Technology PLC
645 Newmarket Road
Cambridge, CB5 8PB, United Kingdom         WWW: http://www.pacemicro.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mkfs.jffs2 failing to use zlib to compress things
  2002-07-22 16:25 mkfs.jffs2 failing to use zlib to compress things Stewart Brodie
@ 2002-07-30 22:48 ` David Woodhouse
  0 siblings, 0 replies; 2+ messages in thread
From: David Woodhouse @ 2002-07-30 22:48 UTC (permalink / raw)
  To: Stewart Brodie; +Cc: linux-mtd

stewart.brodie@pace.co.uk said:
> I have been having problems with mkfs.jffs2 (with the fs/jffs2 files
> from a MIPS Linux 2.4.17 kernel) not compressing files as it
> constructs the filesystem image.  I have no idea whether this will
> affect the run-time behaviour or not - I've not got that far.  After
> inserting debugging into the compression routines, it appears that
> Z_STREAM_ERROR streaming errors are occurring when the data is being
> passed through zlib, and thus the simple rtime compression is being
> used instead.

> It looks like mkfs.jffs2 is driving zlib's compression routines in a
> bizarre way (c.f. the decompression which uses a trivial loop) passing
> only small blocks of data at a time.  Is that loop correct?  Why is
> Z_PARTIAL_FLUSH being used?  The errors I get are all "final deflate
> returned -2".

> Any ideas what might be causing this? 

We compress only a page of data at a time, so we can get at them easily on 
demand without having to decompress a larger stream and discard some of the 
result. Normally, we do only one call to zlib_deflate() with 
Z_PARTIAL_FLUSH, which manages to deflate the entire input buffer. Then we 
try to do the Z_FINISH. I don't know why that would cause an error.

This is the same code as we use in the kernel though -- so it's possible 
that the same error is occurring there.

--
dwmw2

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-07-30 22:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-22 16:25 mkfs.jffs2 failing to use zlib to compress things Stewart Brodie
2002-07-30 22:48 ` David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox