From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964999AbdEWFsA (ORCPT ); Tue, 23 May 2017 01:48:00 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46957 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934600AbdEWFr4 (ORCPT ); Tue, 23 May 2017 01:47:56 -0400 From: Ankit Kumar 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 X-Mailer: git-send-email 2.7.4 X-TM-AS-MML: disable x-cbid: 17052305-0016-0000-0000-0000023F64BB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17052305-0017-0000-0000-000006BCCBD4 Message-Id: <1495518412-7175-1-git-send-email-ankit@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-23_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705230029 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Ankit Kumar Reviewed-by: Mahesh Salgaonkar --- 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