Thread (44 messages) flat view 44 messages, 4 authors, 2024-02-01

Re: [PATCH v3 1/3] pidfd: allow pidfd_open() on non-thread-group leaders

From: Tycho Andersen <tycho@tycho.pizza>
Date: 2024-01-27 20:44:57
Also in: lkml

On Sat, Jan 27, 2024 at 08:31:27PM +0100, Oleg Nesterov wrote:
On 01/27, Tycho Andersen wrote:
quoted
quoted
quoted
quoted
exit_notify() is called after exit_files(). pidfd_getfd() returns
ESRCH if the exiting thread completes release_task(), otherwise it
returns EBADF because ->files == NULL. This too doesn't really
depend on PIDFD_THREAD.
Yup, understood. It just seems like an inconsistency we might want to
fix.
Not sure this worth "fixing"...
Yep, maybe not. Just wanted to point it out.
On the second thought I am starting to understand your concern...

Indeed, in this case -EBADF is technically correct but it can confuse
the user which doesn't or can't know that this task/thread is exiting,
because EBADF looks as if the "int fd" argument was wrong.

Sorry I missed your point before.
No worries. I realized it's not so hard to fix with your new
xxx_exited() helper from the PIDFD_THREAD patch, so maybe worth
cleaning up after all?

Tycho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help