Updating hypfs information

6.14 LPAR mode z/VM guest

You trigger the update process by writing something into the update attribute at the top-level hypfs directory.

Procedure

With hypfs mounted at /sys/hypervisor/s390, you can trigger the update process by issuing the following command:
# echo 1 > /sys/hypervisor/s390/update

During the update, the entire directory structure is deleted and rebuilt. If a file was open before the update, subsequent reads return the old data until the file is opened again. Within 1 second only one update can be done. If multiple updates are triggered within a second, only the first update is performed and subsequent write system calls return -1 and errno is set to EBUSY.

Applications can use the following procedure to ensure consistent data:

  1. Read the modification time through stat(2) from the update attribute.
  2. If the data is too old, write to the update attribute and start again with step 1.
  3. Read data from the file system.
  4. Read the modification time of the update attribute again and compare it with first timestamp. If the timestamps do not match, return to step 2.