summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeepa Dinamani <deepa.kernel@gmail.com>2019-06-24 02:00:01 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-07 19:56:59 +0300
commit2c16f72135fb70aff833032f460886bd005747d4 (patch)
tree927a1ee6fc260a7bc1b896d2854b593bf27dab48
parent0c09b02842b8b766b92887a424a0bafccb4bafd2 (diff)
downloadlinux-2c16f72135fb70aff833032f460886bd005747d4.tar.xz
pstore: fs superblock limits
[ Upstream commit 83b8a3fbe3aa82ac3c253b698ae6a9be2dbdd5e0 ] Leaving granularity at 1ns because it is dependent on the specific attached backing pstore module. ramoops has microsecond resolution. Fix the readback of ramoops fractional timestamp microseconds, which has incorrectly been reporting the value as nanoseconds. Fixes: 3f8f80f0cfeb ("pstore/ram: Read and write to the 'compressed' flag of pstore"). Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Acked-by: Kees Cook <keescook@chromium.org> Acked-by: Jeff Layton <jlayton@kernel.org> Cc: anton@enomsg.org Cc: ccross@android.com Cc: keescook@chromium.org Cc: tony.luck@intel.com Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/pstore/ram.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 316c16463b20..015d74ee31a0 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -162,6 +162,7 @@ static int ramoops_read_kmsg_hdr(char *buffer, struct timespec64 *time,
if (sscanf(buffer, RAMOOPS_KERNMSG_HDR "%lld.%lu-%c\n%n",
(time64_t *)&time->tv_sec, &time->tv_nsec, &data_type,
&header_length) == 3) {
+ time->tv_nsec *= 1000;
if (data_type == 'C')
*compressed = true;
else
@@ -169,6 +170,7 @@ static int ramoops_read_kmsg_hdr(char *buffer, struct timespec64 *time,
} else if (sscanf(buffer, RAMOOPS_KERNMSG_HDR "%lld.%lu\n%n",
(time64_t *)&time->tv_sec, &time->tv_nsec,
&header_length) == 2) {
+ time->tv_nsec *= 1000;
*compressed = false;
} else {
time->tv_sec = 0;