lkml.org 
[lkml]   [2018]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] pstore: add lz4hc and 842 compression support
Date
On Tue, Nov 28, 2017 at 05:44:52PM -0800, Kees Cook wrote:
> > +
> > + ret = LZ4_compress_default(in, out, inlen, outlen, workspace);
> > + if (!ret) {
> > + pr_err("LZ4_compress_default error; compression failed!\n");
> > + return -EIO;
> > + }
> > +
> > + return ret;
>
> Other compress/decompress return outlen, rather than ret. Is "ret" the
> outlen here?
>

> > +
> > + ret = LZ4_compress_HC(in, out, inlen, outlen,
> > + LZ4HC_DEFAULT_CLEVEL, workspace);
> > + if (!ret) {
> > + pr_err("LZ4_compress_HC error; compression failed!\n");
> > + return -EIO;
> > + }
> > +
> > + return ret;
>
> And here?
>

Yes, ret is outlen in LZ4_compress_default and LZ4_compress_HC.

> > +
> > + ret = sw842_compress(in, inlen, out, &len, workspace);
> > + if (!ret) {
> > + pr_err("sw842_compress error; compression failed!\n");
> > + return -EIO;
> > + }
> > + outlen = len;
>
> This has no effect. What was intended?
>

> > + ret = sw842_decompress(in, inlen, out, &len);
> > + if (ret < 0) {
> > + pr_err("sw842_decompress error, ret = %d!\n", ret);
> > + return -EIO;
> > + }
> > + outlen = len;
>
> Same.
>

I fixed them in patch v3.

>
> Otherwise this all looks good. Thanks!
>
> -Kees
>
> --
> Kees Cook
> Pixel Security

Geliang Tang (1):
pstore: add lz4hc and 842 compression support

fs/pstore/Kconfig | 25 +++++++++
fs/pstore/platform.c | 147 ++++++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 154 insertions(+), 18 deletions(-)

--
2.14.1

\
 
 \ /
  Last update: 2018-02-11 15:38    [W:0.122 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site