From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Ulf Hansson <ulf.hansson@linaro.org>, Gary R Hook <ghook@amd.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>
Subject: Re: [PATCH 2/2] debugfs: return error values, not NULL
Date: Mon, 28 Jan 2019 17:04:28 +0100 [thread overview]
Message-ID: <20190128160428.GA29379@kroah.com> (raw)
In-Reply-To: <20190128225513.6511badcfcd93c3b6d7b453c@kernel.org>
On Mon, Jan 28, 2019 at 10:55:13PM +0900, Masami Hiramatsu wrote:
> Hi Greg,
>
> On Thu, 24 Jan 2019 11:26:52 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
>
> > On Wed, 23 Jan 2019 11:28:14 +0100
> > Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> >
> > > When an error happens, debugfs should return an error pointer value, not
> > > NULL. This will prevent the totally theoretical error where a debugfs
> > > call fails due to lack of memory, returning NULL, and that dentry value
> > > is then passed to another debugfs call, which would end up succeeding,
> > > creating a file at the root of the debugfs tree, but would then be
> > > impossible to remove (because you can not remove the directory NULL).
> > >
> > > So, to make everyone happy, always return errors, this makes the users
> > > of debugfs much simpler (they do not have to ever check the return
> > > value), and everyone can rest easy.
> >
> > With Greg's return check removal patches, I'm OK for this change.
> >
> > Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
> >
> > Thank you,
> >
> > >
> > > Reported-by: Masami Hiramatsu <mhiramat@kernel.org>
> > > Reported-by: Ulf Hansson <ulf.hansson@linaro.org>
> > > Reported-by: Gary R Hook <ghook@amd.com>
> > > Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> > > Cc: stable <stable@vger.kernel.org>
>
> BTW, would you really think it should go to stable? It seems an improvement
> instead of a bugfix...
See later in the thread, I decided that was not the correct thing to do
:)
thanks,
greg k-h
prev parent reply other threads:[~2019-01-28 16:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-23 10:27 [PATCH 1/2] debugfs: fix debugfs_rename parameter checking Greg Kroah-Hartman
2019-01-23 10:28 ` [PATCH 2/2] debugfs: return error values, not NULL Greg Kroah-Hartman
2019-01-23 10:29 ` Greg Kroah-Hartman
2019-01-23 10:31 ` Greg Kroah-Hartman
2019-01-23 11:06 ` Michal Hocko
2019-01-23 11:55 ` Greg Kroah-Hartman
2019-01-23 12:13 ` Michal Hocko
2019-01-23 12:26 ` Greg Kroah-Hartman
2019-01-23 12:40 ` Michal Hocko
2019-01-23 13:00 ` Greg Kroah-Hartman
2019-01-23 13:09 ` Michal Hocko
2019-01-23 13:40 ` Greg Kroah-Hartman
2019-01-23 13:49 ` Greg Kroah-Hartman
2019-01-23 13:54 ` Michal Hocko
2019-01-23 21:32 ` Sebastian Andrzej Siewior
2019-01-24 2:26 ` Masami Hiramatsu
2019-01-28 13:55 ` Masami Hiramatsu
2019-01-28 16:04 ` Greg Kroah-Hartman [this message]
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=20190128160428.GA29379@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=ghook@amd.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=ulf.hansson@linaro.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.