pstore: Add file extension to pstore file if compressed
In case decompression fails, add a ".enc.z" to indicate the file has compressed data. This will help user space utilities to figure out the file contents. Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Tony Luck <tony.luck@intel.com>
This commit is contained in:

committed by
Tony Luck

parent
adb42f5e10
commit
9ad2cbe0a9
@@ -479,13 +479,15 @@ void pstore_get_records(int quiet)
|
||||
if (unzipped_len > 0) {
|
||||
buf = big_oops_buf;
|
||||
size = unzipped_len;
|
||||
compressed = false;
|
||||
} else {
|
||||
pr_err("pstore: decompression failed;"
|
||||
"returned %d\n", unzipped_len);
|
||||
compressed = true;
|
||||
}
|
||||
}
|
||||
rc = pstore_mkfile(type, psi->name, id, count, buf,
|
||||
(size_t)size, time, psi);
|
||||
compressed, (size_t)size, time, psi);
|
||||
if (unzipped_len < 0) {
|
||||
/* Free buffer other than big oops */
|
||||
kfree(buf);
|
||||
|
Reference in New Issue
Block a user