diff options
| author | Jamie Lokier <jamie@shareable.org> | 2003-10-08 04:59:16 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-10-08 04:59:16 -0700 |
| commit | c69f289480b185efa8c23bca2154473c21407bf0 (patch) | |
| tree | 95337cb47d0a1bcf334f3dbacd80d3f51915a5f4 /kernel | |
| parent | d9e033b3bd2100d08dd85f41457476c5311464c7 (diff) | |
[PATCH] set sigio target to current->pid and only if not already set
1. send_sigio() sends to a specific thread, _not_ a process.
(It can also send to a process group, but that's not relevant here).
This is useful, and should stay as it is.
Therefore it makes _no sense_ to call f_setown() with current->tgid.
Presently the kernel is inconsistent about it, with some places using
current->pid and some others using current->tgid.
This patch changes f_setown() calls to use current->pid.
2. In some places, f_setown() is called not at the user's direct request,
but as a side effect of another function. Specifically: dnotify and
file leases.
It is good to allow a program the flexibility to specify a different
pid than the default, using F_SETOWN. Presently they can do this after
the dnotify or lease call, but there is a small time window when it
will be temporarily set to current->tgid (which as pointed out above,
is not always right).
The window is avoidable if the program can use F_SETOWN prior to the
dnotify or lease call. This is exactly what the "force" argument to
f_setown() is for, and this patch changes it to zero in those callers.
This change is not likely to affect any existing programs.
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/futex.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index db0a81a810dd..7b1e11a08257 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -500,7 +500,7 @@ static int futex_fd(unsigned long uaddr, int signal) if (signal) { int err; - err = f_setown(filp, current->tgid, 1); + err = f_setown(filp, current->pid, 1); if (err < 0) { put_unused_fd(ret); put_filp(filp); |
