Skip to content

Commit c25829e

Browse files
deepa-hubgregkh
authored andcommitted
pstore: fs superblock limits
[ Upstream commit 83b8a3f ] 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: 3f8f80f ("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>
1 parent b32e4cc commit c25829e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎fs/pstore/ram.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,15 @@ static int ramoops_read_kmsg_hdr(char *buffer, struct timespec64 *time,
144144
if (sscanf(buffer, RAMOOPS_KERNMSG_HDR "%lld.%lu-%c\n%n",
145145
(time64_t *)&time->tv_sec, &time->tv_nsec, &data_type,
146146
&header_length) == 3) {
147+
time->tv_nsec *= 1000;
147148
if (data_type == 'C')
148149
*compressed = true;
149150
else
150151
*compressed = false;
151152
} else if (sscanf(buffer, RAMOOPS_KERNMSG_HDR "%lld.%lu\n%n",
152153
(time64_t *)&time->tv_sec, &time->tv_nsec,
153154
&header_length) == 2) {
155+
time->tv_nsec *= 1000;
154156
*compressed = false;
155157
} else {
156158
time->tv_sec = 0;

0 commit comments

Comments
 (0)