From: He Zhe <zhe.he@windriver.com>
To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Petr Mladek <pmladek@suse.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] printk: Fix panic caused by passing log_buf_len to command line
Date: Tue, 25 Sep 2018 23:31:05 +0800 [thread overview]
Message-ID: <656c4059-ba7b-6756-5e7c-b4cf41c62a2a@windriver.com> (raw)
In-Reply-To: <20180925133143.GB601@tigerII.localdomain>
On 2018年09月25日 21:31, Sergey Senozhatsky wrote:
> On (09/25/18 14:23), Petr Mladek wrote:
>> The 32GB was mentioned as an example one year ego. This is not enough
>> for a new syscall from my point of view.
> I agree. I didn't think of syslog(); was merely thinking about logbuf
> and flushing it to the consoles. syslog() stuff is a bit complex. We
> sort of don't expect user space to allocate 64G to read all log_buf
> messages, do we.
>
> I'm wondering if we can do something like this
>
> ---
>
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index cf275f4d7912..1b48b61da8fe 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -1110,9 +1110,15 @@ static void __init log_buf_len_update(unsigned size)
> /* save requested log_buf_len since it's too early to process it */
> static int __init log_buf_len_setup(char *str)
> {
> - unsigned size = memparse(str, &str);
> + u64 size = memparse(str, &str);
>
> - log_buf_len_update(size);
> + if (size > UINT_MAX) {
> + size = UINT_MAX;
> + pr_err("log_buf over 4G is not supported. "
> + "Please contact printk maintainers.\n");
> + }
> +
> + log_buf_len_update((unsigned int)size);
>
> return 0;
> }
>
> ---
>
> So we could know that "the day has come".
I agree on this idea, a good way to collect the potential requirement.
I can send v4 with it if no objection from other people.
Thanks,
Zhe
>
> -ss
>
next prev parent reply other threads:[~2018-09-25 15:32 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-18 17:17 [PATCH v2 1/2] printk: Fix panic caused by passing log_buf_len to command line zhe.he
2018-09-18 17:17 ` [PATCH v2 2/2] printk: Add KBUILD_MODNAME and correct bare use of unsigned zhe.he
2018-09-19 2:06 ` Sergey Senozhatsky
2018-09-19 11:20 ` Petr Mladek
2018-09-19 1:50 ` [PATCH v2 1/2] printk: Fix panic caused by passing log_buf_len to command line Sergey Senozhatsky
2018-09-19 2:27 ` He Zhe
2018-09-19 2:39 ` Sergey Senozhatsky
2018-09-19 2:43 ` Steven Rostedt
2018-09-19 2:47 ` Sergey Senozhatsky
2018-09-19 3:05 ` Steven Rostedt
2018-09-20 16:16 ` He Zhe
2018-09-20 16:30 ` Steven Rostedt
2018-09-21 7:37 ` Petr Mladek
2018-09-22 15:36 ` He Zhe
2018-09-25 12:16 ` Sergey Senozhatsky
2018-09-25 12:01 ` Sergey Senozhatsky
2018-09-25 12:23 ` Petr Mladek
2018-09-25 12:37 ` Sergey Senozhatsky
2018-09-25 13:31 ` Sergey Senozhatsky
2018-09-25 15:31 ` He Zhe [this message]
2018-09-26 11:05 ` Petr Mladek
2018-09-28 7:35 ` Sergey Senozhatsky
2018-09-28 8:22 ` He Zhe
2018-09-19 6:44 ` Sergey Senozhatsky
2018-09-19 10:09 ` He Zhe
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=656c4059-ba7b-6756-5e7c-b4cf41c62a2a@windriver.com \
--to=zhe.he@windriver.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky.work@gmail.com \
--cc=sergey.senozhatsky@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).