Skip to contentSkip to conversation

misuse of fget_raw() in perf_event_get()

DISCUSSION Al Viro 3 participants 4 messages Apr 13, 2019 – Jun 27, 2019 VFS

lore
Share & tools
lore

Al Viro

author maintainer
#0 lore raw

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

#1 lore raw
Quoted 2 lines · Al Viro

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?

#2 lore raw
Quoted 7 lines · Alexei Starovoitov
Quoted 2 lines · Al Viro

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/[email protected]

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

author maintainer
#3 lore raw
Quoted 12 lines · Peter Zijlstra
Quoted 7 lines · Alexei Starovoitov
Quoted 2 lines · Al Viro

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.

Quoted 6 lines

If you look at:

lkml.kernel.org/r/[email protected]

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...