Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'please-pull-pstore' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux

Pull pstore/compression fixes from Tony Luck:
"Three pstore fixes related to compression:
1) Better adjustment of size of compression buffer (was too big for
EFIVARS backend resulting in compression failure
2) Use zlib_inflateInit2 instead of zlib_inflateInit
3) Don't print messages about compression failure. They will waste
space that may better be used to log console output leading to the
crash"

* tag 'please-pull-pstore' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux:
pstore: Remove the messages related to compression failure
pstore: Use zlib_inflateInit2 instead of zlib_inflateInit
pstore: Adjust buffer size for compression for smaller registered buffers

+23 -6
+23 -6
fs/pstore/platform.c
··· 168 168 int err, ret; 169 169 170 170 ret = -EIO; 171 - err = zlib_inflateInit(&stream); 171 + err = zlib_inflateInit2(&stream, WINDOW_BITS); 172 172 if (err != Z_OK) 173 173 goto error; 174 174 ··· 195 195 static void allocate_buf_for_compression(void) 196 196 { 197 197 size_t size; 198 + size_t cmpr; 198 199 199 - big_oops_buf_sz = (psinfo->bufsize * 100) / 45; 200 + switch (psinfo->bufsize) { 201 + /* buffer range for efivars */ 202 + case 1000 ... 2000: 203 + cmpr = 56; 204 + break; 205 + case 2001 ... 3000: 206 + cmpr = 54; 207 + break; 208 + case 3001 ... 3999: 209 + cmpr = 52; 210 + break; 211 + /* buffer range for nvram, erst */ 212 + case 4000 ... 10000: 213 + cmpr = 45; 214 + break; 215 + default: 216 + cmpr = 60; 217 + break; 218 + } 219 + 220 + big_oops_buf_sz = (psinfo->bufsize * 100) / cmpr; 200 221 big_oops_buf = kmalloc(big_oops_buf_sz, GFP_KERNEL); 201 222 if (big_oops_buf) { 202 223 size = max(zlib_deflate_workspacesize(WINDOW_BITS, MEM_LEVEL), ··· 316 295 compressed = true; 317 296 total_len = zipped_len; 318 297 } else { 319 - pr_err("pstore: compression failed for Part %d" 320 - " returned %d\n", part, zipped_len); 321 - pr_err("pstore: Capture uncompressed" 322 - " oops/panic report of Part %d\n", part); 323 298 compressed = false; 324 299 total_len = copy_kmsg_to_buffer(hsize, len); 325 300 }