public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: pierre kuo <vichy.kuo@gmail.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	rostedt@goodmis.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC V2] printk: add warning while drop partial text in msg
Date: Wed, 16 Aug 2017 11:21:39 +0200	[thread overview]
Message-ID: <20170816092139.GA30544@pathway.suse.cz> (raw)
In-Reply-To: <CAOVJa8EZc4iQ_sOmOR9B2V7C=iLf7gJzQ0XMXLGRkuQBPVz_Gw@mail.gmail.com>

On Fri 2017-08-11 00:55:48, pierre kuo wrote:
> hi Sergey:
> (Please ignore previous mail, I apologize for pressing send button too early :)
> >> this is not the only place that can truncate the message.
> >> vprintk_emit() can do so as well /* vscnprintf() */. but
> >> I think we don't care that much. a user likely will  notice
> >> truncated messages. we report lost messages, because this
> >> is a completely different sort of problem.
> Usually people will more easily find message truncated from semantics
> by vscnprintf, since it brute force truncate input message by the
> upper limit of output buffer.

Do you see the problem in the real life, please?

I ask because msg_print_text() seems to be used carefully.

For example, syslog_idx is bumped in syslog_print() only when
the message fits into the buffer. It repeats the read with an
empty buffer until the bigger userspace buffer is full.

Also kmsg_dump_get_buffer() first checks the size of the messages.
Then it calls msg_print_text() only for messages that fit into
the buffer.

These functions are called from userspace. Of course, all messages
do not fit into the userspace buffer. But userspace repeats the read
until all messages are read. IMHO, nothing is really dropped here.

Best Regards,
Petr

  reply	other threads:[~2017-08-16  9:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-30 13:37 [RFC V2] printk: add warning while drop partial text in msg pierre Kuo
2017-08-01  2:43 ` Sergey Senozhatsky
2017-08-10 16:26   ` pierre kuo
2017-08-10 16:55     ` pierre kuo
2017-08-16  9:21       ` Petr Mladek [this message]
2017-08-17  1:05       ` Sergey Senozhatsky
2017-09-12  6:07         ` pierre kuo
2017-09-18  9:39           ` Sergey Senozhatsky
2017-09-18 10:00             ` Joe Perches
2017-09-18 10:08               ` Sergey Senozhatsky
2017-09-27 13:59             ` pierre kuo
2017-09-30  3:14               ` Sergey Senozhatsky
2017-10-04 13:28               ` Petr Mladek
2017-10-17 17:10                 ` pierre kuo
2017-10-18  1:07                   ` Sergey Senozhatsky
2017-10-04 13:17           ` Petr Mladek
2017-10-17 17:07             ` pierre kuo

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=20170816092139.GA30544@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=vichy.kuo@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