From: Geliang Tang <geliangtang@163.com>
To: Anton Vorontsov <anton@enomsg.org>,
Colin Cross <ccross@android.com>,
Kees Cook <keescook@chromium.org>,
Tony Luck <tony.luck@intel.com>
Cc: Geliang Tang <geliangtang@163.com>, linux-kernel@vger.kernel.org
Subject: [PATCH v2 0/3] pstore: add pstore unregister
Date: Sun, 18 Oct 2015 18:49:22 +0800 [thread overview]
Message-ID: <cover.1445163119.git.geliangtang@163.com> (raw)
In-Reply-To: <CAGXu5jJutpBRdqkkA9T4v-rGZ9XnOYyVpo-DQDNTFOEwonQdfg@mail.gmail.com>
On Fri, Oct 16, 2015 at 08:50:42AM -0700, Kees Cook wrote:
> On Fri, Oct 16, 2015 at 8:25 AM, Geliang Tang <geliangtang@163.com> wrote:
> > +static struct dentry *dir;
>
> Since this is no longer a local, it should probably be renamed
> something more descriptive.
>
I renamed it pstore_ftrace_dir.
> > +static void free_buf_for_compression(void)
> > +{
> > + kfree(stream.workspace);
> > + kfree(big_oops_buf);
>
> I think both of these should be set to NULL after their kfrees.
>
I did it as you suggested.
> > static void pstore_register_console(void)
> > {
> > + pstore_console.flags = CON_PRINTBUFFER | CON_ENABLED | CON_ANYTIME;
>
> Why do these flags need to move here?
>
No need to deal these console flags here specifically. I drop it.
> > - if (owner && !try_module_get(owner)) {
> > - psinfo = NULL;
> > - return -EINVAL;
> > - }
>
> Don't we still need to hold a module reference?
>
Yes. I simply add module_put in pstore_register() to deal with it.
Maybe it's not good enough. Please give me some advices.
Thanks.
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 | 7 +++++++
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, 92 insertions(+), 33 deletions(-)
--
2.5.0
next prev parent reply other threads:[~2015-10-18 10:53 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-16 15:25 [PATCH 1/3] pstore: add vmalloc error check Geliang Tang
2015-10-16 15:25 ` [PATCH 2/3] pstore: add a helper function pstore_register_kmsg Geliang Tang
2015-10-16 15:25 ` [PATCH 3/3] pstore: add 'rmmod ramoops' support Geliang Tang
2015-10-16 15:50 ` Kees Cook
2015-10-18 10:49 ` Geliang Tang [this message]
2015-10-18 10:49 ` [PATCH v2 1/3] pstore: add vmalloc error check Geliang Tang
2015-10-18 10:49 ` [PATCH v2 2/3] pstore: add a helper function pstore_register_kmsg Geliang Tang
2015-10-18 10:49 ` [PATCH v2 3/3] pstore: add pstore unregister Geliang Tang
2015-10-19 22:56 ` Luck, Tony
2015-10-20 7:39 ` [PATCH v3 0/3] " Geliang Tang
2015-10-20 7:39 ` [PATCH v3 1/3] pstore: add vmalloc error check Geliang Tang
2015-10-20 7:39 ` [PATCH v3 2/3] pstore: add a helper function pstore_register_kmsg Geliang Tang
2015-10-20 7:39 ` [PATCH v3 3/3] pstore: add pstore unregister Geliang Tang
2015-10-20 17:19 ` [PATCH v3 0/3] " Kees Cook
2015-10-21 2:52 ` Geliang Tang
2015-10-21 3:01 ` Kees Cook
2015-10-21 4:11 ` Geliang Tang
2015-10-21 16:38 ` Luck, Tony
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=cover.1445163119.git.geliangtang@163.com \
--to=geliangtang@163.com \
--cc=anton@enomsg.org \
--cc=ccross@android.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--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