From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2782AC432C2 for ; Tue, 24 Sep 2019 16:58:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD4BA2054F for ; Tue, 24 Sep 2019 16:58:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569344319; bh=2n/Df1WVmgoy0vgbYlwsWecg+mwB5LQ52yY6MOGpQcM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=g87mSh2iOZpi5ACYk4cYz4BgjNqLqwZui7yzpcWG0QlLGBvroVPMC1w/r9bfQ+p3r sKQRZkjOsTO3FfkxCqgnEPuDsB0jKWvXVWDTjUijMQ+4n9GErMFTsbE9m/5EvVgzGK VITuUMGhrKEI0UGC+HEciFgXbQyE7IAvnsmWWbF0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633336AbfIXQsB (ORCPT ); Tue, 24 Sep 2019 12:48:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:39438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2633314AbfIXQr5 (ORCPT ); Tue, 24 Sep 2019 12:47:57 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B45B20673; Tue, 24 Sep 2019 16:47:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569343676; bh=2n/Df1WVmgoy0vgbYlwsWecg+mwB5LQ52yY6MOGpQcM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mFsQ2xpQVPeHRY2xtuVd3zMb6Ws5rnFw9Puy0IuxLbgejGqjL6IbPmwIyU8QfIPzV kAO0ETES2OAlsXEUIQanlV5CFXJwyqY663fVMUWdDzCZCl+WTpEdYaYgS6peN4FuvU GzXQVeF2cdUwyzBxv992NEJK9Ezsndy73RJyYtNc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Deepa Dinamani , Kees Cook , Jeff Layton , anton@enomsg.org, ccross@android.com, tony.luck@intel.com, Sasha Levin Subject: [PATCH AUTOSEL 5.2 51/70] pstore: fs superblock limits Date: Tue, 24 Sep 2019 12:45:30 -0400 Message-Id: <20190924164549.27058-51-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190924164549.27058-1-sashal@kernel.org> References: <20190924164549.27058-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Deepa Dinamani [ 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 Acked-by: Kees Cook Acked-by: Jeff Layton Cc: anton@enomsg.org Cc: ccross@android.com Cc: keescook@chromium.org Cc: tony.luck@intel.com Signed-off-by: Sasha Levin --- fs/pstore/ram.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 5b77098944151..db9f67d34af37 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -144,6 +144,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 @@ -151,6 +152,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; -- 2.20.1