Re: [PATCH 5/5] ftrace: Use guard to take ftrace_lock in ftrace_graph_set_hash()
From: Steven Rostedt <rostedt@goodmis.org>
Date: 2024-10-28 14:18:56
Also in:
lkml
From: Steven Rostedt <rostedt@goodmis.org>
Date: 2024-10-28 14:18:56
Also in:
lkml
On Mon, 28 Oct 2024 10:16:56 +0100 Peter Zijlstra [off-list ref] wrote:
quoted
@@ -6846,13 +6844,8 @@ ftrace_graph_set_hash(struct ftrace_hash *hash, char *buffer) } } } while_for_each_ftrace_rec(); -out: - mutex_unlock(&ftrace_lock); - if (fail) - return -EINVAL; - - return 0; + return fail ? -EINVAL : 0; }Isn't the fail case more a case of -ESRCH / -ENOENT rather than -EINVAL?
Could be. Although this is mostly for internal use. I should check to see if this gets back to user space. And yeah, it probably should be changed.
Anyway, that's orthogonal, the patch preserves existing semantics and looks okay (as do the others fwiw).
Thanks for the review! -- Steve