Re: [PATCH 11/20] bpf: factor out a bpf_trace_copy_string helper

2020-05-19 Thread Linus Torvalds
On Tue, May 19, 2020 at 9:14 AM Christoph Hellwig wrote: > > I don't think we need it as the case of > > case 'a': > case 'b': > do_stuff(); > break; > > has always been fine even with the fallthough warnings. And the > rest of the stuff gets remove

Re: [PATCH 11/20] bpf: factor out a bpf_trace_copy_string helper

2020-05-19 Thread Christoph Hellwig
On Tue, May 19, 2020 at 09:07:55AM -0700, Linus Torvalds wrote: > On Tue, May 19, 2020 at 6:45 AM Christoph Hellwig wrote: > > > > + switch (fmt_ptype) { > > + case 's': > > +#ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE > > + strncpy_from_unsafe(buf, unsafe_ptr, b

Re: [PATCH 11/20] bpf: factor out a bpf_trace_copy_string helper

2020-05-19 Thread Linus Torvalds
On Tue, May 19, 2020 at 6:45 AM Christoph Hellwig wrote: > > + switch (fmt_ptype) { > + case 's': > +#ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE > + strncpy_from_unsafe(buf, unsafe_ptr, bufsz); > + break; > +#endif > + case 'k': > +

[PATCH 11/20] bpf: factor out a bpf_trace_copy_string helper

2020-05-19 Thread Christoph Hellwig
Split out a helper to do the fault free access to the string pointer to get it out of a crazy indentation level. Signed-off-by: Christoph Hellwig --- kernel/trace/bpf_trace.c | 42 +++- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/kernel/tra