From: Rik van Riel <riel@redhat.com>
To: Roel Kluin <12o3l@tiscali.nl>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] unlock before bug returns
Date: Mon, 22 Oct 2007 00:10:45 -0400 [thread overview]
Message-ID: <20071022001045.131ea465@bree.surriel.com> (raw)
In-Reply-To: <471C11E5.2000003@tiscali.nl>
On Mon, 22 Oct 2007 04:58:45 +0200
Roel Kluin <12o3l@tiscali.nl> wrote:
> Roel Kluin wrote:
>
> > unlock before bug returns
>
> > if (cs >= GPMC_CS_NUM || !gpmc_cs_reserved(cs)) {
> > printk(KERN_ERR "Trying to free non-reserved GPMC
> > CS%d\n", cs);
> > - BUG();
> > spin_unlock(&gpmc_mem_lock);
> > - return;
> > + BUG();
>
>
> should we bother to unlock before panicking, or is the unlock not
> required either?
BUG() kills the current process, but not the whole system.
Unlocking the lock means that the rest of the system has somewhat
of a chance of surviving. Not unlocking means a guaranteed hang
for the rest of the system, making a BUG() no better than panic.
Please keep the unlock.
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan
next prev parent reply other threads:[~2007-10-22 4:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-22 2:10 [PATCH] unlock before bug returns Roel Kluin
2007-10-22 2:58 ` Roel Kluin
2007-10-22 4:10 ` Rik van Riel [this message]
2007-10-22 12:09 ` Roel Kluin
2007-10-22 12:40 ` Pekka Enberg
2007-10-22 12:49 ` Rene Herman
2007-10-22 19:17 ` Roel Kluin
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=20071022001045.131ea465@bree.surriel.com \
--to=riel@redhat.com \
--cc=12o3l@tiscali.nl \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox