Questions about private file locks (Re: Proposed new krb5 FILE ccache protocol)
Nico Williams
nico at cryptonector.com
Wed Jan 29 00:27:00 EST 2014
On Tue, Jan 28, 2014 at 7:21 PM, Greg Hudson <ghudson at mit.edu> wrote:
> [1]
> http://jtlayton.wordpress.com/2014/01/07/file-private-posix-locks-aka-un-posix-locks/
That's very nice. A few questions (I hope Simo or others can relay to
the relevant engineers):
- Do private locks share the same namespace as POSIX file locks?
Surely they must, for many reasons, among others that otherwise NFS
will not support private locks for many, many years.
- What is to be returned in the l_pid field of struct flock when
using F_GETLKP?
My advice: put in a constant, say, (pid_t)-1.
- The blog says that private locks "are owned by the open file".
Does this carry through to dup()/dup2()/...?
Also, what if the same file is opened through several distinct
open()s in the same process?
My guess: it doesn't matter, just explicitly drop locks rather than
close(2) to drop locks. But this should be specified, even if to say
that this is undefined.
Nico
--
More information about the krbdev
mailing list