linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* misuse of fget_raw() in perf_event_get()
@ 2019-04-13 21:02 Al Viro
  2019-04-15  4:42 ` Alexei Starovoitov
  0 siblings, 1 reply; 4+ messages in thread
From: Al Viro @ 2019-04-13 21:02 UTC (permalink / raw)
  To: Alexei Starovoitov; +Cc: linux-fsdevel, linux-kernel

	What's the point of using fget_raw(), if you do
_not_ accept O_PATH descriptors?  That should be fget()...

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: misuse of fget_raw() in perf_event_get()
  2019-04-13 21:02 misuse of fget_raw() in perf_event_get() Al Viro
@ 2019-04-15  4:42 ` Alexei Starovoitov
  2019-04-15  9:04   ` Peter Zijlstra
  0 siblings, 1 reply; 4+ messages in thread
From: Alexei Starovoitov @ 2019-04-15  4:42 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel, linux-kernel, peterz, tj

On Sat, Apr 13, 2019 at 10:02:42PM +0100, Al Viro wrote:
> 	What's the point of using fget_raw(), if you do
> _not_ accept O_PATH descriptors?  That should be fget()...

I think you're talking about commit e03e7ee34fdd ("perf/bpf: Convert perf_event_array to use struct file")
I don't really remember why we went with this instead of fget().
There was a bunch of back and forth back then with Peter.
Now it looks like that it can be fget just fine.
I think cgroup_get_from_fd() should do the same too?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: misuse of fget_raw() in perf_event_get()
  2019-04-15  4:42 ` Alexei Starovoitov
@ 2019-04-15  9:04   ` Peter Zijlstra
  2019-06-27  0:56     ` Al Viro
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Zijlstra @ 2019-04-15  9:04 UTC (permalink / raw)
  To: Alexei Starovoitov; +Cc: Al Viro, linux-fsdevel, linux-kernel, tj

On Sun, Apr 14, 2019 at 09:42:00PM -0700, Alexei Starovoitov wrote:
> On Sat, Apr 13, 2019 at 10:02:42PM +0100, Al Viro wrote:
> > 	What's the point of using fget_raw(), if you do
> > _not_ accept O_PATH descriptors?  That should be fget()...
> 
> I think you're talking about commit e03e7ee34fdd ("perf/bpf: Convert perf_event_array to use struct file")
> I don't really remember why we went with this instead of fget().
> There was a bunch of back and forth back then with Peter.

That was mostly on what refcount to use, you wanted to use the event
refcount, and I suggested using the file refcount.

If you look at:

  lkml.kernel.org/r/20160126161637.GF6357@twins.programming.kicks-ass.net

I too wondered about the fget_raw() at the time, whatever Al wants
though, I never quite remember how that file stuff works :/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: misuse of fget_raw() in perf_event_get()
  2019-04-15  9:04   ` Peter Zijlstra
@ 2019-06-27  0:56     ` Al Viro
  0 siblings, 0 replies; 4+ messages in thread
From: Al Viro @ 2019-06-27  0:56 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: Alexei Starovoitov, linux-fsdevel, linux-kernel, tj

On Mon, Apr 15, 2019 at 11:04:06AM +0200, Peter Zijlstra wrote:
> On Sun, Apr 14, 2019 at 09:42:00PM -0700, Alexei Starovoitov wrote:
> > On Sat, Apr 13, 2019 at 10:02:42PM +0100, Al Viro wrote:
> > > 	What's the point of using fget_raw(), if you do
> > > _not_ accept O_PATH descriptors?  That should be fget()...
> > 
> > I think you're talking about commit e03e7ee34fdd ("perf/bpf: Convert perf_event_array to use struct file")
> > I don't really remember why we went with this instead of fget().
> > There was a bunch of back and forth back then with Peter.
> 
> That was mostly on what refcount to use, you wanted to use the event
> refcount, and I suggested using the file refcount.
> 
> If you look at:
> 
>   lkml.kernel.org/r/20160126161637.GF6357@twins.programming.kicks-ass.net
> 
> I too wondered about the fget_raw() at the time, whatever Al wants
> though, I never quite remember how that file stuff works :/

Anyway, fget() it becomes...

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-27  0:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-13 21:02 misuse of fget_raw() in perf_event_get() Al Viro
2019-04-15  4:42 ` Alexei Starovoitov
2019-04-15  9:04   ` Peter Zijlstra
2019-06-27  0:56     ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).