[exim] spec.txt, NFS and file locking

Góra strony
Delete this message
Reply to this message
Autor: Vincent Lefevre
Data:  
Dla: exim-users
Temat: [exim] spec.txt, NFS and file locking
I've reported the following bug in the Debian BTS[*], as I think that
spec.txt (from exim 4.93) is incorrect.

In /usr/share/doc/exim4-base/spec.txt.gz :

--------
In order to append to an NFS file safely from more than one host, it is
necessary to take out a lock before opening the file, and the lock file
achieves this. Otherwise, even with fcntl() locking, there is a risk of file
corruption.
--------

I don't see why. If used correctly, fcntl() locking should be
sufficient under NFS. And if fcntl() locking is broken, lock files
won't prevent corruption anyway: even if you have the lock, there
is no guarantee that the client will synchronize the changes with
the server before another process gets the lock and do changes
(this is the problem I had with shared zsh history, which often
got corrupted even though zsh used some form of locking... until
I patched it in 2008 to use fcntl() locking).

[*] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=960358

--
Vincent Lefèvre <vincent@???> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)