Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752706AbbKGEyD (ORCPT ); Fri, 6 Nov 2015 23:54:03 -0500 Received: from m50-138.163.com ([123.125.50.138]:55615 "EHLO m50-138.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752186AbbKGEx7 (ORCPT ); Fri, 6 Nov 2015 23:53:59 -0500 From: Geliang Tang To: Anton Vorontsov , Colin Cross , Kees Cook , Tony Luck Cc: Geliang Tang , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] pstore: check PSTORE_FLAGS_FRAGILE in pstore_unregister Date: Sat, 7 Nov 2015 12:43:47 +0800 Message-Id: <337377a3fbcf855d6a5217e06fcd8c8a979f2853.1446869434.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: References: In-Reply-To: References: X-CM-TRANSID: C9GowACXoMicgT1WP0JYBA--.3921S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Gr18WF1UGF4furyfGr4kWFg_yoWfZFg_t3 yIqa4xXrs3u398Kr15Ar13u34xZw4kGrWfX3WUtFs0kw1xJr4kG3sFva4DZr1UJr4xWFZr tay2kFy3uw13GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUj2Nt3UUUUU== X-Originating-IP: [116.77.145.83] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiNR2rmVSIJ9B1OgAAs+ Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1118 Lines: 38 When PSTORE_FLAGS_FRAGILE flag is set, only kmsg is registered in pstore_register. So, under these circumstances, only kmsg needs to be unregistered in pstore_unregister. Signed-off-by: Geliang Tang --- fs/pstore/platform.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 588461b..5b8f1eb 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -497,9 +497,12 @@ EXPORT_SYMBOL_GPL(pstore_register); void pstore_unregister(struct pstore_info *psi) { - pstore_unregister_pmsg(); - pstore_unregister_ftrace(); - pstore_unregister_console(); + if ((psi->flags & PSTORE_FLAGS_FRAGILE) == 0) { + pstore_unregister_pmsg(); + pstore_unregister_ftrace(); + pstore_unregister_console(); + } + pstore_unregister_kmsg(); free_buf_for_compression(); -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/