linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geliang Tang <geliangtang@gmail.com>
To: Kees Cook <keescook@chromium.org>,
	Anton Vorontsov <anton@enomsg.org>,
	Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>
Cc: Geliang Tang <geliangtang@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pstore: add lz4hc and 842 compression support
Date: Sun, 11 Feb 2018 22:37:30 +0800	[thread overview]
Message-ID: <cover.1518356301.git.geliangtang@gmail.com> (raw)
In-Reply-To: <CAGXu5jL+CWgMpBzhOwro7qo=a9kHhSGqp+EDMqKv23k7FOFUzQ@mail.gmail.com>

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

  reply	other threads:[~2018-02-11 14:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28 13:56 [PATCH] pstore: add lz4hc and 842 compression support Geliang Tang
2017-11-02  2:38 ` [PATCH v2] " Geliang Tang
2017-11-29  1:44 ` [PATCH] " Kees Cook
2018-02-11 14:37   ` Geliang Tang [this message]
2018-02-11 14:37     ` [PATCH v3] " Geliang Tang
2018-02-13  6:40       ` [PATCH v4] " Geliang Tang
2018-03-06 23:18         ` Kees Cook

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=cover.1518356301.git.geliangtang@gmail.com \
    --to=geliangtang@gmail.com \
    --cc=anton@enomsg.org \
    --cc=ccross@android.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).