Re: [PATCH 5/5] ftrace: Use guard to take ftrace_lock in ftrace_graph_set_hash()
From: Steven Rostedt
Date: Mon Oct 28 2024 - 10:19:25 EST
On Mon, 28 Oct 2024 10:16:56 +0100
Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> > @@ -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