From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752990AbcERMAe (ORCPT ); Wed, 18 May 2016 08:00:34 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:33844 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752947AbcERMAa (ORCPT ); Wed, 18 May 2016 08:00:30 -0400 From: Namhyung Kim To: Anton Vorontsov , Colin Cross , Kees Cook , Tony Luck Cc: LKML Subject: [PATCH 1/2] pstore: Enable compression on normal path (again) Date: Wed, 18 May 2016 21:00:05 +0900 Message-Id: <1463572806-16194-1-git-send-email-namhyung@kernel.org> X-Mailer: git-send-email 2.8.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commit f0e2efcfd2717 ("pstore: do not use message compression without lock") added a check to 'is_locked' to avoid breakage in concurrent accesses. But it has a side-effect of disabling compression on normal path since 'is_locked' variable is not set. As normal path always takes the lock, it should be initialized to 1. This also makes the unlock code a bit simpler. Signed-off-by: Namhyung Kim --- fs/pstore/platform.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 588461bb2dd4..04a0164a2066 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -284,7 +284,7 @@ static void pstore_dump(struct kmsg_dumper *dumper, u64 id; unsigned int part = 1; unsigned long flags = 0; - int is_locked = 0; + int is_locked = 1; int ret; why = get_reason_str(reason); @@ -350,10 +350,7 @@ static void pstore_dump(struct kmsg_dumper *dumper, total += total_len; part++; } - if (pstore_cannot_block_path(reason)) { - if (is_locked) - spin_unlock_irqrestore(&psinfo->buf_lock, flags); - } else + if (is_locked) spin_unlock_irqrestore(&psinfo->buf_lock, flags); } -- 2.8.0