lkml.org 
[lkml]   [2022]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4 bpf-next 2/4] ftrace: allow IPMODIFY and DIRECT ops on the same function
Date


> On Jul 19, 2022, at 11:28 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
>
>> /**
>> * register_ftrace_function - register a function for profiling
>> * @ops: ops structure that holds the function for profiling.
>> @@ -8016,17 +8192,29 @@ int ftrace_is_dead(void)
>> * recursive loop.
>> */
>> int register_ftrace_function(struct ftrace_ops *ops)
>> + __releases(&direct_mutex)
>> {
>> + bool direct_mutex_locked = false;
>> int ret;
>>
>> ftrace_ops_init(ops);
>>
>
> I agree with Petr.
>
> Just grab the direct_mutex_lock here.
>
> mutex_lock(&direct_mutex);

Actually, we cannot blindly lock direct_mutex here, as
register_ftrace_direct() already locks it before calling
register_ftrace_function(). We still need the if (IPMODIFY)
check.

Thanks,
Song

>
>> + ret = prepare_direct_functions_for_ipmodify(ops);
>> + if (ret < 0)
>> + return ret;
>

\
 
 \ /
  Last update: 2022-07-20 01:25    [W:1.068 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site