printk: Give error on attempt to set log buffer length to over 2G
authorHe Zhe <zhe.he@windriver.com>
Sat, 29 Sep 2018 16:45:53 +0000 (00:45 +0800)
committerPetr Mladek <pmladek@suse.com>
Tue, 9 Oct 2018 12:02:05 +0000 (14:02 +0200)
commite6fe3e5b7d16e8f146a4ae7fe481bc6e97acde1e
tree501f09fb02ba30c5ad9ae153a14740886ed7ae00
parentdd5adbfbfc50ff998909660c6158c0488f7b6a2b
printk: Give error on attempt to set log buffer length to over 2G

The current printk() is ready to handle log buffer size up to 2G.
Give an explicit error for users who want to use larger log buffer.

Also fix printk formatting to show the 2G as a positive number.

Link: http://lkml.kernel.org/r/20181008135916.gg4kkmoki5bgtco5@pathway.suse.cz
Cc: rostedt@goodmis.org
Cc: linux-kernel@vger.kernel.org
Suggested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: He Zhe <zhe.he@windriver.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
[pmladek: Fixed to the really safe limit 2GB.]
Signed-off-by: Petr Mladek <pmladek@suse.com>
kernel/printk/printk.c