S390: dasd: support DIAG access for read-only devices
authorStefan Weinhuber <wein@de.ibm.com>
Mon, 7 Dec 2009 11:51:48 +0000 (12:51 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 6 Jan 2010 23:04:54 +0000 (15:04 -0800)
commit1dc51f1054ff6444540c3a3e45aad6657d130562
tree5e24835e97f6c83a248bfc913326e650bebaccae
parent4012cf67b9f1841ad582ca094c230439d98c8a4d
S390: dasd: support DIAG access for read-only devices

commit 22825ab7693fd29769518a0d25ba43c01a50092a upstream.

When a DASD device is used with the DIAG discipline, the DIAG
initialization will indicate success or error with a respective
return code. So far we have interpreted a return code of 4 as error,
but it actually means that the initialization was successful, but
the device is read-only. To allow read-only devices to be used with
DIAG we need to accept a return code of 4 as success.

Re-initialization of the DIAG access is also part of the DIAG error
recovery. If we find that the access mode of a device has been
changed from writable to read-only while the device was in use,
we print an error message.

Signed-off-by: Stefan Weinhuber <wein@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Stephen Powell <zlinuxman@wowway.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/s390/block/dasd_diag.c