From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941256AbcLVN2L (ORCPT ); Thu, 22 Dec 2016 08:28:11 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34680 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938874AbcLVN2J (ORCPT ); Thu, 22 Dec 2016 08:28:09 -0500 Date: Thu, 22 Dec 2016 22:27:51 +0900 From: Sergey Senozhatsky To: Sven Schmidt <4sschmid@informatik.uni-hamburg.de> Cc: akpm@linux-foundation.org, bongkyu.kim@lge.com, sergey.senozhatsky@gmail.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Anton Vorontsov , Colin Cross , Kees Cook , Tony Luck Subject: Re: [PATCH 2/3] fs/pstore: fs/squashfs: Change lz4 compressor functions to work with new version Message-ID: <20161222132751.GC413@tigerII.localdomain> References: <1482259992-16680-1-git-send-email-4sschmid@informatik.uni-hamburg.de> <1482259992-16680-3-git-send-email-4sschmid@informatik.uni-hamburg.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1482259992-16680-3-git-send-email-4sschmid@informatik.uni-hamburg.de> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cc Anton, Colin, Kees, Tony on this https://marc.info/?l=linux-kernel&m=148226086323932 On (12/20/16 19:53), Sven Schmidt wrote: > > This patch updates the fs/pstore and fs/squashfs to work with the > new LZ4 kernel module version. > > Signed-off-by: Sven Schmidt <4sschmid@informatik.uni-hamburg.de> > --- > fs/pstore/platform.c | 11 +++++------ > fs/squashfs/lz4_wrapper.c | 3 +-- > 2 files changed, 6 insertions(+), 8 deletions(-) > > diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c > index 729677e..037dc07 100644 > --- a/fs/pstore/platform.c > +++ b/fs/pstore/platform.c > @@ -342,7 +342,7 @@ static int compress_lz4(const void *in, void *out, size_t inlen, size_t outlen) > { > int ret; > > - ret = lz4_compress(in, inlen, out, &outlen, workspace); > + ret = LZ4_compress_default(in, out, inlen, outlen, workspace); > if (ret) { > pr_err("lz4_compress error, ret = %d!\n", ret); > return -EIO; > @@ -355,7 +355,7 @@ static int decompress_lz4(void *in, void *out, size_t inlen, size_t outlen) > { > int ret; > > - ret = lz4_decompress_unknownoutputsize(in, inlen, out, &outlen); > + ret = LZ4_decompress_safe(in, out, inlen, outlen); > if (ret) { > pr_err("lz4_decompress error, ret = %d!\n", ret); > return -EIO; > @@ -366,7 +366,7 @@ static int decompress_lz4(void *in, void *out, size_t inlen, size_t outlen) > > static void allocate_lz4(void) > { > - big_oops_buf_sz = lz4_compressbound(psinfo->bufsize); > + big_oops_buf_sz = LZ4_compressBound(psinfo->bufsize); > big_oops_buf = kmalloc(big_oops_buf_sz, GFP_KERNEL); > if (big_oops_buf) { > workspace = kmalloc(LZ4_MEM_COMPRESS, GFP_KERNEL); > @@ -493,7 +493,6 @@ static void pstore_dump(struct kmsg_dumper *dumper, > if (!is_locked) { > pr_err("pstore dump routine blocked in %s path, may corrupt error record\n" > , in_nmi() ? "NMI" : why); > - return; > } > } else { > spin_lock_irqsave(&psinfo->buf_lock, flags); > @@ -585,8 +584,8 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c) > } else { > spin_lock_irqsave(&psinfo->buf_lock, flags); > } > - psinfo->write_buf(PSTORE_TYPE_CONSOLE, 0, &id, 0, > - s, 0, c, psinfo); > + memcpy(psinfo->buf, s, c); > + psinfo->write(PSTORE_TYPE_CONSOLE, 0, &id, 0, 0, 0, c, psinfo); > spin_unlock_irqrestore(&psinfo->buf_lock, flags); > s += c; > c = e - s; > diff --git a/fs/squashfs/lz4_wrapper.c b/fs/squashfs/lz4_wrapper.c > index ff4468b..c087a63 100644 > --- a/fs/squashfs/lz4_wrapper.c > +++ b/fs/squashfs/lz4_wrapper.c > @@ -108,8 +108,7 @@ static int lz4_uncompress(struct squashfs_sb_info *msblk, void *strm, > put_bh(bh[i]); > } > > - res = lz4_decompress_unknownoutputsize(stream->input, length, > - stream->output, &dest_len); > + res = LZ4_decompress_safe(stream->input, stream->output, length, (int)dest_len); > if (res) > return -EIO; > > -- > 2.1.4 >