[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.01.0908200816090.3158@localhost.localdomain>
Date:	Thu, 20 Aug 2009 08:32:48 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	David Howells <dhowells@...hat.com>
cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] Use the cut_here() function in AFS, CacheFiles,
 FS-Cache and RxRPC
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
