Reading and resetting the reservation state
How the DASD device driver handles I/O requests depends on the last_known_reservation_state sysfs attribute of the DASD.
About this task
The last_known_reservation_state
attribute
reflects the reservation state as held by the DASD device driver and
can differ from the actual reservation state. Use the tunedasd -Q command
to find out the actual reservation state. The last_known_reservation_state
sysfs
attribute can have the following values:
- none
- The DASD device driver has no information about the device reservation state. I/O requests are processed as usual. If the DASD is reserved by another system, the I/O requests remain in the queue until they time out, or until the reservation is released.
- reserved
- The DASD device driver holds a valid reservation for the DASD
and I/O requests are processed as usual. The DASD device driver changes
this state if notified that the DASD is no longer reserved to this
system. The new state depends on the reservation policy.
- ignore
- The state is changed to
none
. - fail
- The state is changed to
lost
.
- lost
- The DASD device driver had reserved the DASD, but subsequently
another system has unconditionally reserved the DASD.
The device driver processes only requests that query the actual device
reservation state. All other I/O requests for the device are returned
as failed. When the error that led another system to unconditionally reserve the DASD is resolved and the DASD has been released by this other system, there are two methods for resuming operations.
- Setting the DASD offline and back online.
- Resetting the reservation state of the DASD.
Attention: Do not resume operations by resetting the reservation state unless your system setup maintains data integrity on the DASD despite:- The I/O errors that are caused by the unconditional reservation
- Any changes to the DASD through the other system
You reset the reservation state by writing
reset
to thelast_known_reservation_state
sysfs attribute of the DASD. Resetting is possible only for thefail
reservation policy (see Handling lost device reservations) and only while the value of thelast_known_reservation_state
attribute islost
.
To find out the reservation state of a DASD
issue a command of this form:
# cat /sys/bus/ccw/devices/<device_bus_id>/last_known_reservation_state
where <device_bus_id> specifies
the DASD.Example
The command in this example queries the
reservation state of a DASD with bus ID
0.0.7009
. # cat /sys/bus/ccw/devices/0.0.7009/last_known_reservation_state
reserved