* [PATCH -next] ring-buffer: Fix ring buffer size in rb_write_something
@ 2018-09-23 12:11 YueHaibing
2019-03-26 1:36 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2018-09-23 12:11 UTC (permalink / raw)
To: Steven Rostedt, Ingo Molnar; +Cc: YueHaibing, linux-kernel, kernel-janitors
'cnt' should be used to calculate ring buffer size rather than data->cnt
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
kernel/trace/ring_buffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 65bd461..53538c3 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -4924,7 +4924,7 @@ static __init int rb_write_something(struct rb_test_data *data, bool nested)
cnt = data->cnt + (nested ? 27 : 0);
/* Multiply cnt by ~e, to make some unique increment */
- size = (data->cnt * 68 / 25) % (sizeof(rb_string) - 1);
+ size = (cnt * 68 / 25) % (sizeof(rb_string) - 1);
len = size + sizeof(struct rb_item);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] ring-buffer: Fix ring buffer size in rb_write_something
2018-09-23 12:11 [PATCH -next] ring-buffer: Fix ring buffer size in rb_write_something YueHaibing
@ 2019-03-26 1:36 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2019-03-26 1:36 UTC (permalink / raw)
To: YueHaibing; +Cc: Ingo Molnar, linux-kernel, kernel-janitors
On Sun, 23 Sep 2018 12:11:33 +0000
YueHaibing <yuehaibing@huawei.com> wrote:
> 'cnt' should be used to calculate ring buffer size rather than data->cnt
I just found this patch in my inbox (was traveling at the time. But now
I have patchwork attached to my INBOX so patches like these shouldn't
be missed anymore!)
Yes, you are correct, this should be fixed. But as it is just for a
startup test, I'll queue it for the next merge window.
Thanks and sorry for the delay.
-- Steve
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> kernel/trace/ring_buffer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index 65bd461..53538c3 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -4924,7 +4924,7 @@ static __init int rb_write_something(struct
> rb_test_data *data, bool nested) cnt = data->cnt + (nested ? 27 : 0);
>
> /* Multiply cnt by ~e, to make some unique increment */
> - size = (data->cnt * 68 / 25) % (sizeof(rb_string) - 1);
> + size = (cnt * 68 / 25) % (sizeof(rb_string) - 1);
>
> len = size + sizeof(struct rb_item);
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-26 1:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-23 12:11 [PATCH -next] ring-buffer: Fix ring buffer size in rb_write_something YueHaibing
2019-03-26 1:36 ` Steven Rostedt
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).