Re: [PATCH] Make POSIX locks compatible with the NPTL thread model

From: Trond Myklebust
Date: Wed Jun 23 2004 - 14:52:19 EST


På on , 23/06/2004 klokka 15:29, skreiv Chris Wright:
> Just ran some quick tests to verify this patch still works fine with
> execve() after plain CLONE_FILES as well as full CLONE_THREAD. Passed
> my tests. Nice to see the steal_locks bit go. However, without this
> patch (only the prior one, I'm getting an oops).

Can you show us the Oops? I'm surprised that should be occurring...

Note that with both patches, we still have some problems in the locking
downcall interface to the filesystem. Currently there exists an
atomicity problem: after the call to ->lock() there is a window during
which the filesystem believes that a lock may have been taken/released
but the VFS has not yet registered this fact. In 2.4.x, this window did
not exist because the VFS held the BKL from beginning to end.

As far as NFS is concerned, this makes use of the VFS in order to
recover from server reboots (which is in fact the only reason why we
bother to have the VFS track the locking) buggy...

IMHO, NFS/CIFS/... should just call posix_lock_file() directly from
their ->lock() method. That way they will also be able to full take
responsibility for protecting the call.

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/