diff options
author | Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com> | 2013-08-16 13:53:39 -0700 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2013-08-19 11:53:27 -0700 |
commit | 9ad2cbe0a9b88ee6ee895d03b2c63fa1252c8e52 (patch) | |
tree | d1fa9f66973963feb802ba28772f9a10e2db5205 /fs/pstore/inode.c | |
parent | adb42f5e105502aff2fc4518b16ba79c203fae4f (diff) | |
download | linux-9ad2cbe0a9b88ee6ee895d03b2c63fa1252c8e52.tar.gz |
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>
Diffstat (limited to 'fs/pstore/inode.c')
-rw-r--r-- | fs/pstore/inode.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 6a4123d1849c..12823845d324 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -275,8 +275,8 @@ int pstore_is_mounted(void) * Set the mtime & ctime to the date that this record was originally stored. */ int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, int count, - char *data, size_t size, struct timespec time, - struct pstore_info *psi) + char *data, bool compressed, size_t size, + struct timespec time, struct pstore_info *psi) { struct dentry *root = pstore_sb->s_root; struct dentry *dentry; @@ -315,7 +315,8 @@ int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, int count, switch (type) { case PSTORE_TYPE_DMESG: - sprintf(name, "dmesg-%s-%lld", psname, id); + sprintf(name, "dmesg-%s-%lld%s", psname, id, + compressed ? ".enc.z" : ""); break; case PSTORE_TYPE_CONSOLE: sprintf(name, "console-%s", psname); |