[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMEuxRqpQeQoNsbzFf8ZZ6=SfiZ0LA64yfZ7yv3xjfUGK7vyyw@mail.gmail.com>
Date: Mon, 19 Sep 2022 15:28:11 -0700
From: Li Zhong <floridsleeves@...il.com>
To: Sergey Senozhatsky <senozhatsky@...omium.org>
Cc: linux-kernel@...r.kernel.org, tony.luck@...el.com,
ccross@...roid.com, anton@...msg.org, keescook@...omium.org,
john.ogness@...utronix.de, rostedt@...dmis.org, pmladek@...e.com
Subject: Re: [PATCH v1] kernel/printk: check return value of console_trylock()
On Sun, Sep 18, 2022 at 6:11 AM Sergey Senozhatsky
<senozhatsky@...omium.org> wrote:
>
> On (22/09/16 18:58), Li Zhong wrote:
> > Check the console_trylock() return value in case it fails.
> [..]
> > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> > index a1a81fd9889b..2c6a0484315b 100644
> > --- a/kernel/printk/printk.c
> > +++ b/kernel/printk/printk.c
> > @@ -2937,7 +2937,8 @@ void console_flush_on_panic(enum con_flush_mode mode)
> > * context and we don't want to get preempted while flushing,
> > * ensure may_schedule is cleared.
> > */
> > - console_trylock();
> > + if (!console_trylock())
> > + return;
>
> It supposed to be ignored and the comment above (in the code)
> explains why: this is panic flush, we want to proceed regardless.
Thanks for your explanation.
Powered by blists - more mailing lists