Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1546423
| From | Sven Schmidt <4sschmid@informatik.uni-hamburg.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/3] fs/pstore: fs/squashfs: Change lz4 compressor functions to work with new version |
| Date | 2016-12-22 16:40 +0100 |
| Message-ID | <sRdDk-2MH-15@gated-at.bofh.it> (permalink) |
| References | <sRbBv-1B3-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 12/22/2016 02:21 PM, Sergey Senozhatsky wrote:
> On (12/20/16 19:53), Sven Schmidt wrote:
>> @@ -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;
>
> why did you remove this "failed to lock buf in critical path" 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);
>
> why extra memcpy()?
>
> -ss
>
>> 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;
>
Hey Sergey and thanks for your time. I'm afraid I messed up the diffstat on this.
Actually I just replaced the function calls and corrected the use of return values.
I will send an updated patchset later since there also have been errors
reported from the buildbots.
Sven
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 2/3] fs/pstore: fs/squashfs: Change lz4 compressor functions to work with new version Sven Schmidt <4sschmid@informatik.uni-hamburg.de> - 2016-12-20 20:10 +0100
Re: [PATCH 2/3] fs/pstore: fs/squashfs: Change lz4 compressor functions to work with new version kbuild test robot <lkp@intel.com> - 2016-12-21 06:20 +0100
Re: [PATCH 2/3] fs/pstore: fs/squashfs: Change lz4 compressor functions to work with new version kbuild test robot <lkp@intel.com> - 2016-12-21 06:20 +0100
Re: [PATCH 2/3] fs/pstore: fs/squashfs: Change lz4 compressor functions to work with new version Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-12-22 14:30 +0100
Re: [PATCH 2/3] fs/pstore: fs/squashfs: Change lz4 compressor functions to work with new version Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-12-22 16:40 +0100
Re: [PATCH 2/3] fs/pstore: fs/squashfs: Change lz4 compressor functions to work with new version Sven Schmidt <4sschmid@informatik.uni-hamburg.de> - 2016-12-22 16:40 +0100
Re: [PATCH 2/3] fs/pstore: fs/squashfs: Change lz4 compressor functions to work with new version Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-12-22 14:30 +0100
csiph-web