From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753403AbbJTHmw (ORCPT ); Tue, 20 Oct 2015 03:42:52 -0400 Received: from m12-18.163.com ([220.181.12.18]:42793 "EHLO m12-18.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752752AbbJTHmv (ORCPT ); Tue, 20 Oct 2015 03:42:51 -0400 From: Geliang Tang To: Anton Vorontsov , Colin Cross , Kees Cook , Tony Luck Cc: Geliang Tang , linux-kernel@vger.kernel.org Subject: [PATCH v3 0/3] pstore: add pstore unregister Date: Tue, 20 Oct 2015 00:39:00 -0700 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: <3908561D78D1C84285E8C5FCA982C28F32B59323@ORSMSX114.amr.corp.intel.com> X-CM-TRANSID: EsCowEA5cVud7yVWtZDjCA--.61390S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7urW3Gw15uF47uFW3Gw17Wrg_yoW8Ary7pw s3C345trWrJF9rJw13Xa17ZrnYkF1ftr4xXr12qw1xtw45u34Svr4UtF1SkFy5JrykCr1x XF1rur45WFyDZrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UYYL9UUUUU= X-Originating-IP: [218.17.162.133] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiMB+ZmVWBR6bLJAAAs1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 19, 2015 at 10:56:54PM +0000, Luck, Tony wrote: > Thanks for looking to close out this TODO item. > > The thing that scared me about unloading pstore was what happens to > a process that is in the middle of reading some /sys/fs/pstore/file-name-here > > Do we have all the right reference counts to make sure that process doesn't do > weird things if you rmmod pstore in the middle of a read? Or for a subsequent > read from the still-open file descriptor? > > -Tony Thanks for your review. I updated the patches as you suggested. // Increase a reference count when pstore file is read. static const struct file_operations pstore_file_operations = { + .owner = THIS_MODULE, .open = pstore_file_open, .read = pstore_file_read, .llseek = pstore_file_llseek, // Increase a reference count when pstore is mounted. static struct file_system_type pstore_fs_type = { + .owner = THIS_MODULE, .name = "pstore", .mount = pstore_mount, .kill_sb = pstore_kill_sb, --- Changes in v3: - Increase a reference count when pstore is used. Changes in v2: - Add pstore filesystem unregister. - update commit log. --- Geliang Tang (3): pstore: add vmalloc error check pstore: add a helper function pstore_register_kmsg pstore: add pstore unregister fs/pstore/Kconfig | 2 +- fs/pstore/Makefile | 6 +++--- fs/pstore/ftrace.c | 23 ++++++++++++++++++----- fs/pstore/inode.c | 9 +++++++++ fs/pstore/internal.h | 4 ++++ fs/pstore/platform.c | 42 +++++++++++++++++++++++++++++++++++++++++- fs/pstore/pmsg.c | 9 +++++++++ fs/pstore/ram.c | 17 +++++++---------- include/linux/pstore.h | 14 +------------- kernel/printk/printk.c | 1 + 10 files changed, 94 insertions(+), 33 deletions(-) -- 1.9.1