z/OS UNIX System Services Planning
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Locking files in the sysplex

z/OS UNIX System Services Planning
GA32-0884-00

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.

If the following situations occur, the locks for the corresponding files are considered to be lost:
  • 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.
Existing applications that have locked those files are prevented from accessing those files. Specifically, after a failure where byte range locks are lost, z/OS UNIX provides the following information to processes that have used byte range locking:
  • 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.

Note: The F BPXOINIT,SHUTDOWN=FILESYS|FILEOWNER and F OMVS,SHUTDOWN commands do not cause a signal to be generated just because an application has lost byte range locks, although a signal might be generated for other reasons during shutdown processing.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014