2007-11-27 16:30:23

by Martin Schwidefsky

[permalink] [raw]
Subject: [patch 3/4] dcssblk: prevent early access without own make_request function

From: Christian Borntraeger <[email protected]>

When loading a dcss segment with the dcssblk driver, sometimes the
following kind of message appears:

bio too big device dcssblk0 (8 > 0)
Buffer I/O error on device dcssblk0, logical block 172016
..

The fix is to move the disk registration after setting the
make_request function, to avoid calls into generic_make_request
for dcssblock without having the make_request function set up
properly.

Cc: Gerald Schaefer <[email protected]>
Signed-off-by: Christian Borntraeger <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
---

drivers/s390/block/dcssblk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Index: quilt-2.6/drivers/s390/block/dcssblk.c
===================================================================
--- quilt-2.6.orig/drivers/s390/block/dcssblk.c
+++ quilt-2.6/drivers/s390/block/dcssblk.c
@@ -472,11 +472,11 @@ dcssblk_add_store(struct device *dev, st
if (rc)
goto unregister_dev;

- add_disk(dev_info->gd);
-
blk_queue_make_request(dev_info->dcssblk_queue, dcssblk_make_request);
blk_queue_hardsect_size(dev_info->dcssblk_queue, 4096);

+ add_disk(dev_info->gd);
+
switch (dev_info->segment_type) {
case SEG_TYPE_SR:
case SEG_TYPE_ER:

--
blue skies,
Martin.

"Reality continues to ruin my life." - Calvin.