Re: [PATCH v4 bpf-next 2/4] ftrace: allow IPMODIFY and DIRECT ops on the same function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Jul 19, 2022, at 11:28 AM, Steven Rostedt <rostedt@xxxxxxxxxxx> 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;
> 




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux