Re: [PATCH v5 4/4] printk: Give error on attempt to set log buffer length to over 4G

2018-10-10 Thread Sergey Senozhatsky
On (10/10/18 10:09), Petr Mladek wrote: > > > +#define LOG_BUF_LEN_MAX (u32)(1 << 31) > > [..] > > > + if (size > (u64)LOG_BUF_LEN_MAX) { > > > + size = (u64)LOG_BUF_LEN_MAX; > > > + pr_err("log_buf over 2G is not supported.\n"); > > > + } > > > > Why not INT_MAX? > > INT_MAX is 0

Re: [PATCH v5 4/4] printk: Give error on attempt to set log buffer length to over 4G

2018-10-10 Thread Petr Mladek
On Tue 2018-10-09 22:57:58, Sergey Senozhatsky wrote: > On (10/09/18 15:05), Petr Mladek wrote: > > > > > > Yeah, I think we gonna have problems even with a 4G logbuf and a 32-bit > > > user-space doing syslog(int len). > > > > > > I agree on the "not motivated enough" part ;) > > > > OK, I have

Re: [PATCH v5 4/4] printk: Give error on attempt to set log buffer length to over 4G

2018-10-09 Thread Sergey Senozhatsky
On (10/09/18 15:05), Petr Mladek wrote: > > > > Yeah, I think we gonna have problems even with a 4G logbuf and a 32-bit > > user-space doing syslog(int len). > > > > I agree on the "not motivated enough" part ;) > > OK, I have pushed an updated patch that has the limit 2GB > into printk.git, for

Re: [PATCH v5 4/4] printk: Give error on attempt to set log buffer length to over 4G

2018-10-09 Thread Petr Mladek
On Mon 2018-10-08 23:59:50, Sergey Senozhatsky wrote: > On (10/08/18 15:59), Petr Mladek wrote: > > I tried this patch with log_buf_len=5G. The kernel did not crash > > but dmesg shown some mess. There are several 32-bit variables > > to store the size, for example: > > > > static u32 log_buf_len

Re: [PATCH v5 4/4] printk: Give error on attempt to set log buffer length to over 4G

2018-10-08 Thread He Zhe
On 2018年10月08日 21:59, Petr Mladek wrote: > I tried this patch with log_buf_len=5G. The kernel did not crash > but dmesg shown some mess. There are several 32-bit variables > to store the size, for example: > > static u32 log_buf_len = __LOG_BUF_LEN; > u32 log_buf_len_get(void) > static u32 log_f

Re: [PATCH v5 4/4] printk: Give error on attempt to set log buffer length to over 4G

2018-10-08 Thread Sergey Senozhatsky
On (10/08/18 15:59), Petr Mladek wrote: > I tried this patch with log_buf_len=5G. The kernel did not crash > but dmesg shown some mess. There are several 32-bit variables > to store the size, for example: > > static u32 log_buf_len = __LOG_BUF_LEN; > u32 log_buf_len_get(void) > static u32 log_firs

Re: [PATCH v5 4/4] printk: Give error on attempt to set log buffer length to over 4G

2018-10-08 Thread Petr Mladek
On Sun 2018-09-30 00:45:53, zhe...@windriver.com wrote: > From: He Zhe > > Give explicit error for users who want to use larger log buffer. > > Signed-off-by: He Zhe > Cc: pmla...@suse.com > Cc: sergey.senozhat...@gmail.com > Cc: rost...@goodmis.org > --- > kernel/printk/printk.c | 11

Re: [PATCH v5 4/4] printk: Give error on attempt to set log buffer length to over 4G

2018-10-01 Thread Sergey Senozhatsky
On (09/30/18 00:45), zhe...@windriver.com wrote: > From: He Zhe > > Give explicit error for users who want to use larger log buffer. > > Signed-off-by: He Zhe > Cc: pmla...@suse.com > Cc: sergey.senozhat...@gmail.com > Cc: rost...@goodmis.org Suggested-by: Sergey Senozhatsky So people will kn

[PATCH v5 4/4] printk: Give error on attempt to set log buffer length to over 4G

2018-09-29 Thread zhe.he
From: He Zhe Give explicit error for users who want to use larger log buffer. Signed-off-by: He Zhe Cc: pmla...@suse.com Cc: sergey.senozhat...@gmail.com Cc: rost...@goodmis.org --- kernel/printk/printk.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/kernel/pr