Locking files in the sysplex
You can lock all or part of a file that you are accessing for read/write purposes by using the byte range lock manager (BRLM).
The lock manager is initialized on every system in the sysplex. This is known as distributed BRLM, and it is the only supported byte range locking method. Each BRLM is responsible for handling locking requests for files whose file systems are mounted locally in that system.
z/OS UNIX backs up each lock in the application's system when the actual lock is stored in another system. This redundant locking provides recovery of locks when a system in the sysplex terminates abnormally. If z/OS UNIX is able to successfully recover a file system, then it restores the locks held for files in that file system. Doing so prevents error conditions from occurring.
- z/OS UNIX cannot recover the file system and unmounts it, including unmounting due to a MODIFY OMVS,STOPPFS command.
- NOAUTOMOVE was specified for the file system.
- Any lock for a file was not successfully backed up.
- Access to open files for which byte range locks are held by any process will result in an I/O error. The file must be closed and reopened before use can continue.
- A signal is issued to any process which has made use of byte range locking. By default, a
SIGTERM signal is issued against every such process and an EC6 abend with reason code 0D258038 will
terminate the process. If you do not want the process to be terminated, the process can use BPX1PCT
(the physical file system control callable service) to specify a different signal for z/OS UNIX to use for notifying the process that the BRLM has
failed. Any signal can be used for this purpose, thus allowing the user or application the ability
to catch or ignore the signal and react accordingly.
z/OS MVS System Codes describes the system completion code EC6 and its associated reason codes. See z/OS UNIX System Services Programming: Assembler Callable Services Reference for more information about BPX1PCT.