All of lore.kernel.org
 help / color / mirror / Atom feed
From: Riku Voipio <riku.voipio@iki.fi>
To: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] compr_lzo.c: allocate enough memory for lzo compressor.
Date: Fri, 11 Apr 2008 14:07:02 +0300	[thread overview]
Message-ID: <20080411110702.GA15263@kos.to> (raw)
In-Reply-To: <1207911122.9544.29.camel@gentoo-jocke.transmode.se>

On Fri, Apr 11, 2008 at 12:52:02PM +0200, Joakim Tjernlund wrote:
> 
> On Fri, 2008-04-11 at 12:33 +0300, Riku Voipio wrote:
> > This is the same bug as in kernel, pointed out the LZO author
> > (Markus Oberhumer):
> > 
> > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=f2a11b158a24301e9158e9c873fa88e5eb775486
> > ---
> >  compr_lzo.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/compr_lzo.c b/compr_lzo.c
> > index fb54600..a0bb362 100644
> > --- a/compr_lzo.c
> > +++ b/compr_lzo.c
> > @@ -97,7 +97,7 @@ int jffs2_lzo_init(void)
> >  		return -1;
> >  
> >  	/* Worse case LZO compression size from their FAQ */
> > -	lzo_compress_buf = malloc(page_size + (page_size / 64) + 16 + 3);
> > +	lzo_compress_buf = malloc(page_size + (page_size / 16) + 64 + 3);
> >  	if (!lzo_compress_buf) {
> >  		free(lzo_mem);
> >  		return -1;

> I think you should use lzo1x_worst_compress() from the link you posted
> above.

lzo1x_worst_compress() is in the kernel header, while patch is for the
userland mtd-utils. The kernel header doesn't seem to get installed
with make headers_install, so I can't use it from userland. Also,
liblzo2 headers don't provide such function (although IMO they should).


-- 
"rm -rf" only sounds scary if you don't have backups

  reply	other threads:[~2008-04-11 11:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-11  9:33 [PATCH] compr_lzo.c: allocate enough memory for lzo compressor Riku Voipio
2008-04-11 10:52 ` Joakim Tjernlund
2008-04-11 11:07   ` Riku Voipio [this message]
2008-04-17 11:47 ` Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080411110702.GA15263@kos.to \
    --to=riku.voipio@iki.fi \
    --cc=joakim.tjernlund@transmode.se \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.