Messages in this thread | | | Date | Thu, 6 Jan 2022 17:17:45 -0500 | From | Steven Rostedt <> | Subject | Re: [PATCH v8 08/12] user_events: Optimize writing events by only copying data once |
| |
On Thu, 16 Dec 2021 09:35:07 -0800 Beau Belgrave <beaub@linux.microsoft.com> wrote:
> @@ -1018,16 +1081,11 @@ static ssize_t user_events_write_core(struct file *file, struct iov_iter *i) > if (likely(atomic_read(&tp->key.enabled) > 0)) { > struct tracepoint_func *probe_func_ptr; > user_event_func_t probe_func; > + struct iov_iter copy; > void *tpdata; > - void *kdata; > - u32 datalen; > - > - kdata = kmalloc(i->count, GFP_KERNEL); > > - if (unlikely(!kdata)) > - return -ENOMEM; > - > - datalen = copy_from_iter(kdata, i->count, i); > + if (unlikely(iov_iter_fault_in_readable(i, i->count)))
Can you rebase on my tree: ftrace/core ?
That's because upstream now has:
a6294593e8a12 ("iov_iter: Turn iov_iter_fault_in_readable into fault_in_iov_iter_readable")
And it looks like you need to call fault_in_iov_iter_readable().
-- Steve
> + return -EFAULT; > > rcu_read_lock_sched(); >
| |