From: tytso@mit.edu
To: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Amerigo Wang <amwang@redhat.com>,
linux-kernel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>,
Jens Axboe <jens.axboe@oracle.com>, Nick Piggin <npiggin@suse.de>,
linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [Patch] fs: remove a useless BUG()
Date: Tue, 1 Dec 2009 13:52:25 -0500 [thread overview]
Message-ID: <20091201185225.GB6278@thunk.org> (raw)
In-Reply-To: <20091201165440.GA2688@joi.lan>
On Tue, Dec 01, 2009 at 05:55:11PM +0100, Marcin Slusarz wrote:
> On Mon, Nov 30, 2009 at 09:34:14PM -0500, Amerigo Wang wrote:
> > This BUG() is suspicious, it makes its following statements
> > unreachable,
> only when CONFIG_BUG=y
Which is true for all kernels except for the very rare embedded case.
> > and it seems to be useless, since the caller
> > of this function already handles the failure properly.
> because this function can return NULL in other codepath
>
> > Remove it.
> I don't know why this BUG() is there (and maybe it's not really
> needed), but your rationale is wrong.
Your reply is a bit snarky, IMHO. It might have been nicer and more
courteous if you had bothered to take a closer look at the patch
before firing off a reply.
In fact, it's good to avoid BUG() if at all possible, especially if it
can happen in the normally course of events --- such as running out of
memory. Having code which triggers an BUG in an low memory situation
is very bad form.
Looks good to me.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
- Ted
next prev parent reply other threads:[~2009-12-01 18:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-01 2:34 [Patch] fs: remove a useless BUG() Amerigo Wang
2009-12-01 16:55 ` Marcin Slusarz
2009-12-01 18:52 ` tytso [this message]
2009-12-02 8:52 ` Nick Piggin
2009-12-02 22:14 ` Andrew Morton
2009-12-08 10:13 ` Cong Wang
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=20091201185225.GB6278@thunk.org \
--to=tytso@mit.edu \
--cc=akpm@linux-foundation.org \
--cc=amwang@redhat.com \
--cc=jens.axboe@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcin.slusarz@gmail.com \
--cc=npiggin@suse.de \
--cc=viro@zeniv.linux.org.uk \
/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