lkml.org 
[lkml]   [2003]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ->pid in dnotify
Ulrich Drepper wrote:
> Also keep in mind that threads can go away while the process (and
> therefore file descriptor) remain. And the ID of the thread can be
> reused

The problem of owner churn goes beyond threads - fds can be passed to
other process and outlive the original thread or process which created
them. Changing ->pid to ->tgid doesn't fix this.

Using ->tgid in dnotify is at least consistent with fcntl_setlease()
in locks.c, and the call to f_setown() in futex.c.

Unfortunately I can think of a few situations where you would want the
signal delivered to one thread, but none where you'd want it delivered
to a whole process (same for dnotify and setlease).

Userspace can change the pid straight after to ->pid using
fcntl(fd,F_SETOWN,...), but that leaves a time window where a thread
creates a dnotify or lease, and the signal will be delivered
process-wide until the thread can direct it to itself.

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.025 / U:22.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site