Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tracing: Remove unneeded event_mutex lock in event_trigger_regex_release()

In event_trigger_regex_release(), the only code is:

mutex_lock(&event_mutex);
if (file->f_mode & FMODE_READ)
seq_release(inode, file);
mutex_unlock(&event_mutex);

return 0;

There's nothing special about the file->f_mode or the seq_release() that
requires any locking. Remove the unnecessary locks.

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Tom Zanussi <zanussi@kernel.org>
Link: https://patch.msgid.link/20251125214031.975879283@kernel.org
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

-4
-4
kernel/trace/trace_events_trigger.c
··· 314 314 315 315 static int event_trigger_regex_release(struct inode *inode, struct file *file) 316 316 { 317 - mutex_lock(&event_mutex); 318 - 319 317 if (file->f_mode & FMODE_READ) 320 318 seq_release(inode, file); 321 - 322 - mutex_unlock(&event_mutex); 323 319 324 320 return 0; 325 321 }