Commit 1e0291ba authored by Peter Oberparleiter's avatar Peter Oberparleiter Committed by Linus Torvalds

[PATCH] s390: dasd diag with block sizes > 512

Access to FBA disks via DIAG fails for block sizes > 512 byte.  The device
analysis code of the DIAG discipline does not properly initialize the DIAG250
device environment after completion of the analysis.  This results in VM only
serving 512 bytes per block I/O request whereas Linux expects larger block
sizes.  Add proper device environment setup to end of analysis code.
Signed-off-by: default avatarPeter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 86b368a5
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
* *
* $Revision: 1.50 $ * $Revision: 1.51 $
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -404,18 +404,23 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -404,18 +404,23 @@ dasd_diag_check_device(struct dasd_device *device)
private->iob.bio_list = &bio; private->iob.bio_list = &bio;
private->iob.flaga = DASD_DIAG_FLAGA_DEFAULT; private->iob.flaga = DASD_DIAG_FLAGA_DEFAULT;
rc = dia250(&private->iob, RW_BIO); rc = dia250(&private->iob, RW_BIO);
if (rc == 0 || rc == 3)
break;
mdsk_term_io(device);
}
if (rc == 3) { if (rc == 3) {
DEV_MESSAGE(KERN_WARNING, device, "%s", "DIAG call failed"); DEV_MESSAGE(KERN_WARNING, device, "%s",
"DIAG call failed");
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
} else if (rc != 0) { goto out;
}
mdsk_term_io(device);
if (rc == 0)
break;
}
if (bsize > PAGE_SIZE) {
DEV_MESSAGE(KERN_WARNING, device, "device access failed " DEV_MESSAGE(KERN_WARNING, device, "device access failed "
"(rc=%d)", rc); "(rc=%d)", rc);
rc = -EIO; rc = -EIO;
} else { goto out;
}
/* check for label block */
if (memcmp(label->label_id, DASD_DIAG_CMS1, if (memcmp(label->label_id, DASD_DIAG_CMS1,
sizeof(DASD_DIAG_CMS1)) == 0) { sizeof(DASD_DIAG_CMS1)) == 0) {
/* get formatted blocksize from label block */ /* get formatted blocksize from label block */
...@@ -427,14 +432,19 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -427,14 +432,19 @@ dasd_diag_check_device(struct dasd_device *device)
device->s2b_shift = 0; /* bits to shift 512 to get a block */ device->s2b_shift = 0; /* bits to shift 512 to get a block */
for (sb = 512; sb < bsize; sb = sb << 1) for (sb = 512; sb < bsize; sb = sb << 1)
device->s2b_shift++; device->s2b_shift++;
rc = mdsk_init_io(device, device->bp_block, 0, NULL);
if (rc) {
DEV_MESSAGE(KERN_WARNING, device, "DIAG initialization "
"failed (rc=%d)", rc);
rc = -EIO;
} else {
DEV_MESSAGE(KERN_INFO, device, DEV_MESSAGE(KERN_INFO, device,
"(%ld B/blk): %ldkB", "(%ld B/blk): %ldkB",
(unsigned long) device->bp_block, (unsigned long) device->bp_block,
(unsigned long) (device->blocks << (unsigned long) (device->blocks <<
device->s2b_shift) >> 1); device->s2b_shift) >> 1);
rc = 0;
} }
out:
free_page((long) label); free_page((long) label);
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment