7.10 File Locking in AFS
The file locking mechanism in AFS does not really follow POSIX semantics. There are a few issues to mention:
- Files may only be locked as a whole; regions of a file may not be locked.
- File locking only works properly and reliably from a single system. If a file is locked from one client and an attempt is made to access the file from another client, the error
EWOULDBLOCK is returned.
- There is no deadlock prevention in AFS, so deadlock situations can occur with file locking.
- Any program that attempts to use byte-range file locking in AFS will get a message from the cache manager warning that other users may be accessing the same file. Usually these messages can be safely ignored.
Generally we don't recommend including applications that depend on file locking in the AFS file space. Contact the helpdesk for more information or for resolution of a problem.