mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ankit Kumar <ankit@linux.vnet.ibm.com>
To: keescook@chromium.org, anton@enomsg.org, ccross@android.com,
	tony.luck@intel.com
Cc: linux-kernel@vger.kernel.org, anton@au1.ibm.com,
	mahesh@linux.vnet.ibm.com, hbathini@linux.vnet.ibm.com,
	hegdevasant@linux.vnet.ibm.com, ankit@linux.vnet.ibm.com
Subject: [PATCH]pstore: Don't warn if data is uncompressed and type is not PSTORE_TYPE_DMESG
Date: Tue, 23 May 2017 11:16:52 +0530	[thread overview]
Message-ID: <1495518412-7175-1-git-send-email-ankit@linux.vnet.ibm.com> (raw)

commit 9abdcccc3d5f ("pstore: Extract common arguments into structure") moved
record decompression to function. decompress_record() gets called without
checking type and compressed flag. Warning will be reported if data is
uncompressed. Pstore type PSTORE_TYPE_PPC_OPAL, PSTORE_TYPE_PPC_COMMON doesn't
contain compressed data and warning get printed part of dmesg.

Partial dmesg log:
[   35.848914] pstore: ignored compressed record type 6
[   35.848927] pstore: ignored compressed record type 8

Above warning should not get printed as it is known that data won't be
compressed for above type and it is valid condition.

This patch returns if data is not compressed and print warning only if data is
compressed and type is not PSTORE_TYPE_DMESG.

Reported-by: Anton Blanchard <anton@au1.ibm.com>
Signed-off-by: Ankit Kumar <ankit@linux.vnet.ibm.com>
Reviewed-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
---
 fs/pstore/platform.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index d468eec..b304553 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -770,8 +770,11 @@ static void decompress_record(struct pstore_record *record)
 	int unzipped_len;
 	char *decompressed;
 
+	if (!record->compressed)
+		return;
+
 	/* Only PSTORE_TYPE_DMESG support compression. */
-	if (!record->compressed || record->type != PSTORE_TYPE_DMESG) {
+	if (record->type != PSTORE_TYPE_DMESG) {
 		pr_warn("ignored compressed record type %d\n", record->type);
 		return;
 	}
-- 
2.7.4

             reply	other threads:[~2017-05-23  5:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23  5:46 Ankit Kumar [this message]
2017-05-24 17:12 ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1495518412-7175-1-git-send-email-ankit@linux.vnet.ibm.com \
    --to=ankit@linux.vnet.ibm.com \
    --cc=anton@au1.ibm.com \
    --cc=anton@enomsg.org \
    --cc=ccross@android.com \
    --cc=hbathini@linux.vnet.ibm.com \
    --cc=hegdevasant@linux.vnet.ibm.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mahesh@linux.vnet.ibm.com \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome