Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1252472
| From | Rusty Russell <rusty@rustcorp.com.au> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] module: Prevent recursion bug caused by module RCU check |
| Date | 2015-10-21 07:10 +0200 |
| Message-ID | <qlTOW-1kX-5@gated-at.bofh.it> (permalink) |
| References | <qlHXs-Cg-3@gated-at.bofh.it> <qlIgN-YP-9@gated-at.bofh.it> <qlIqt-1ak-5@gated-at.bofh.it> <qlIAb-1CH-27@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Peter Zijlstra <peterz@infradead.org> writes:
> On Tue, Oct 20, 2015 at 06:53:31PM +0200, Peter Zijlstra wrote:
>> Also, would it not be better to fix WARN_ON_ONCE() instead?
>>
>
> Clearly I'm an idiot and should stay away from the computer...
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
(I mean, the patch, not the comment on Peter's intellect! If he's too
dumb to go near computers, most of us should probably shy away from
anything with buttons....)
Thanks,
Rusty.
> ---
> include/asm-generic/bug.h | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
> index 630dd2372238..d0972fc8433f 100644
> --- a/include/asm-generic/bug.h
> +++ b/include/asm-generic/bug.h
> @@ -110,9 +110,10 @@ extern void warn_slowpath_null(const char *file, const int line);
> static bool __section(.data.unlikely) __warned; \
> int __ret_warn_once = !!(condition); \
> \
> - if (unlikely(__ret_warn_once)) \
> - if (WARN_ON(!__warned)) \
> - __warned = true; \
> + if (unlikely(__ret_warn_once && !__warned)) { \
> + __warned = true; \
> + WARN_ON(1); \
> + } \
> unlikely(__ret_warn_once); \
> })
>
> @@ -120,9 +121,10 @@ extern void warn_slowpath_null(const char *file, const int line);
> static bool __section(.data.unlikely) __warned; \
> int __ret_warn_once = !!(condition); \
> \
> - if (unlikely(__ret_warn_once)) \
> - if (WARN(!__warned, format)) \
> - __warned = true; \
> + if (unlikely(__ret_warn_once && !__warned)) { \
> + __warned = true; \
> + WARN(1, format); \
> + } \
> unlikely(__ret_warn_once); \
> })
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] module: Prevent recursion bug caused by module RCU check Steven Rostedt <rostedt@goodmis.org> - 2015-10-20 18:30 +0200
Re: [PATCH] module: Prevent recursion bug caused by module RCU check Steven Rostedt <rostedt@goodmis.org> - 2015-10-20 18:50 +0200
Re: [PATCH] module: Prevent recursion bug caused by module RCU check Peter Zijlstra <peterz@infradead.org> - 2015-10-20 19:00 +0200
Re: [PATCH] module: Prevent recursion bug caused by module RCU check Peter Zijlstra <peterz@infradead.org> - 2015-10-20 18:50 +0200
Re: [PATCH] module: Prevent recursion bug caused by module RCU check Peter Zijlstra <peterz@infradead.org> - 2015-10-20 19:00 +0200
Re: [PATCH] module: Prevent recursion bug caused by module RCU check Peter Zijlstra <peterz@infradead.org> - 2015-10-20 19:10 +0200
Re: [PATCH] module: Prevent recursion bug caused by module RCU check Steven Rostedt <rostedt@goodmis.org> - 2015-10-20 20:30 +0200
Re: [PATCH] module: Prevent recursion bug caused by module RCU check Rusty Russell <rusty@rustcorp.com.au> - 2015-10-21 07:10 +0200
csiph-web