mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: David Howells <dhowells@redhat.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] Use the cut_here() function in AFS, CacheFiles, FS-Cache and RxRPC
Date: Thu, 20 Aug 2009 08:32:48 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0908200816090.3158@localhost.localdomain> (raw)
In-Reply-To: <20090820105001.29972.33221.stgit@warthog.procyon.org.uk>



On Thu, 20 Aug 2009, David Howells wrote:
>
> Use the cut_here() function in AFS, CacheFiles, FS-Cache and RxRPC to put
> pertinent extra information between the "cut here" line and the BUG report.

No. This is fundamentally the wrong approach.

>  #define ASSERT(X)						\
>  do {								\
> 	if (unlikely(!(X))) {					\
> -		printk(KERN_ERR "\n");				\
> +		cut_here();					\
>  		printk(KERN_ERR "AFS: Assertion failed\n");	\
>  		BUG();						\

Instead of doing that "cut_here()" thing, you should either use the WARN() 
thing that has a format string already, or we should extend BUG() to have 
that kind of thing too. So in this case I think that you should use WARN() 
instead, ie change it to be

	#define ASSERT(x) do {						\
		if (WARN(X, "AFS: Assertion failed"))		\
			do_exit(SIGSEGV);				\
	} while (0)

instead. And yes, in the long run, I really think we should just extend 
the current BUG() reporting to have that kind of semantics, but I think 
your "cut_here()" thing is a horrible hack.

		Linus

  reply	other threads:[~2009-08-20 15:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20 10:49 [PATCH 1/2] Allow the 'cut here' oops line to be displayed before calling BUG() David Howells
2009-08-20 10:50 ` [PATCH 2/2] Use the cut_here() function in AFS, CacheFiles, FS-Cache and RxRPC David Howells
2009-08-20 15:32   ` Linus Torvalds [this message]
2009-08-20 16:06   ` David Howells
2009-08-20 16:44     ` Linus Torvalds
2009-08-25 11:36 ` [PATCH 1/2] Allow the 'cut here' oops line to be displayed before calling BUG() Pavel Machek

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=alpine.LFD.2.01.0908200816090.3158@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --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

all inboxes | Powered by JetHome®