[PATCH 0/5] POSIX Locking fixes. Take 2...

From: Trond Myklebust
Date: Tue Jun 29 2004 - 19:31:26 EST


Chris Wright's Oops appears to show that relying on the fl_pid is
untenable, since CLONE_FILES does not imply CLONE_THREAD.

The alternative fix is to switch to having the locking code entirely
rely on the file_lock->fl_owner field in order to determine whether or
not locks are owned by the same process. In the special cases of fork()
and NPTL threads, this will still lead to correct POSIX behaviour.

For those that like to fool around with CLONE_THREAD or CLONE_FILES on
their own, however, there is no way to guarantee "correct" behaviour.
The effort has therefore gone towards making it consistent, and allowing
the filesystem to override VFS semantics when it is incapable of
following them.
For NFSv2/v3 this means that we have to allow lockd to manage its own
lockowners. In particular the steal_locks() abomination is impossible to
implement, and so the only secure thing to do is to drop those locks
(note that this is not an issue if the process kills all its threads
before calling exec*() as is required to by the SuS).

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