Commit b5e03080 authored by Sergey Senozhatsky's avatar Sergey Senozhatsky Committed by Lu Jialin
Browse files

seq_buf: Add seq_buf_do_printk() helper

mainline inclusion
from mainline-v6.4-rc1
commit 96928d90
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8C7BS

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=96928d9032a7c34f12a88df879665562bcebf59a

-------------------------------------------------

Sometimes we use seq_buf to format a string buffer, which
we then pass to printk(). However, in certain situations
the seq_buf string buffer can get too big, exceeding the
PRINTKRB_RECORD_MAX bytes limit, and causing printk() to
truncate the string.

Add a new seq_buf helper. This helper prints the seq_buf
string buffer line by line, using \n as a delimiter,
rather than passing the whole string buffer to printk()
at once.

Link: https://lkml.kernel.org/r/20230415100110.1419872-1-senozhatsky@chromium.org



Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
Tested-by: default avatarYosry Ahmed <yosryahmed@google.com>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: default avatarLu Jialin <lujialin4@huawei.com>
parent 87f8b7b4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment