[OpenAFS] namei interface lockf buggy on Solaris (and probably HP-UX and AIX)
Robert Banz
banz@umbc.edu
Mon, 11 Sep 2006 12:06:28 -0400
> Right, only that for a correct flock() emulation you'd also have to
> hold the necessary locks to prevent another thread from seeking
> away between the two calls... ideally something that is independent
> of the namei locking. And the code would gain in readability had
> the ifdefs been packed into a macro or subroutine.
>
> In this precise context however, and without wiping cleaner than
> clean: why spend yet another system call on something that nobody
> cares about.
Hmm. Would it be advisable to switch to using flock or fcntl-style
lock calls on systems which support it for full-file-locks rather
than do the seek()/lock()? At least on Solaris, you should be able
to do an fcntl-style lock specifying the whole file in an atomic step...
-rob