lkml.org 
[lkml]   [2001]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] fix SCSI non-blocksize reads
On Thu Nov 22, 2001 at 10:40:14AM -0800, Linus Torvalds wrote:
>
> On Thu, 22 Nov 2001, Erik Andersen wrote:
> >
> > Would you like a patch that also fixes all the other SCSI drivers
> > to use block_size() then, so they will be consistent?
>
> Eventually yes, although right now I'd like to have the minimal fix.
>

Thanks for getting the aic7xx fix into 2.4.125-greased-turkey.
Here is the rest of the SCSI non-blocksize read clean up patch to
fix up the other SCSI drivers so they also do the right thing. I
think this one easily passes the "obviously correct" test.
Please apply (to 2.4.x and to 2.5.x),

-Erik

--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--


diff -urN linux/drivers/scsi.virgin/BusLogic.c linux/drivers/scsi/BusLogic.c
--- linux/drivers/scsi.virgin/BusLogic.c Sun Sep 30 13:26:07 2001
+++ linux/drivers/scsi/BusLogic.c Fri Nov 23 16:43:52 2001
@@ -4131,7 +4131,7 @@
/*
Attempt to read the first 1024 bytes from the disk device.
*/
- BufferHead = bread(MKDEV(MAJOR(Device), MINOR(Device) & ~0x0F), 0, 1024);
+ BufferHead = bread(MKDEV(MAJOR(Device), MINOR(Device) & ~0x0F), 0, block_size(Device));
if (BufferHead == NULL) return 0;
/*
If the boot sector partition table flag is valid, search for a partition
diff -urN linux/drivers/scsi.virgin/megaraid.c linux/drivers/scsi/megaraid.c
--- linux/drivers/scsi.virgin/megaraid.c Thu Oct 25 14:53:51 2001
+++ linux/drivers/scsi/megaraid.c Fri Nov 23 16:47:08 2001
@@ -4296,15 +4296,7 @@
int heads, cyls, sectors;
int capacity = disk->capacity;

- int ma = MAJOR(dev);
- int mi = (MINOR(dev) & ~0xf);
-
- int block = 1024;
-
- if(blksize_size[ma])
- block = blksize_size[ma][mi];
-
- if(!(bh = bread(MKDEV(ma,mi), 0, block)))
+ if(!(bh = bread(MKDEV(MAJOR(dev), MINOR(dev)&~0xf), 0, block_size(dev))))
return -1;

if( *(unsigned short *)(bh->b_data + 510) == 0xAA55 ) {
diff -urN linux/drivers/scsi.virgin/scsicam.c linux/drivers/scsi/scsicam.c
--- linux/drivers/scsi.virgin/scsicam.c Thu Nov 18 20:09:14 1999
+++ linux/drivers/scsi/scsicam.c Fri Nov 23 16:47:33 2001
@@ -47,15 +47,7 @@
int size = disk->capacity;
unsigned long temp_cyl;

- int ma = MAJOR(dev);
- int mi = (MINOR(dev) & ~0xf);
-
- int block = 1024;
-
- if(blksize_size[ma])
- block = blksize_size[ma][mi];
-
- if (!(bh = bread(MKDEV(ma,mi), 0, block)))
+ if (!(bh = bread(MKDEV(MAJOR(dev), MINOR(dev)&~0xf), 0, block_size(dev))))
return -1;

/* try to infer mapping from partition table */
diff -urN linux/drivers/scsi.virgin/tmscsim.c linux/drivers/scsi/tmscsim.c
--- linux/drivers/scsi.virgin/tmscsim.c Sun Sep 30 13:26:08 2001
+++ linux/drivers/scsi/tmscsim.c Fri Nov 23 16:48:28 2001
@@ -1450,7 +1450,7 @@
int ret_code = -1;
int size = disk->capacity;

- if ((bh = bread(MKDEV(MAJOR(devno), MINOR(devno)&~0xf), 0, 1024)))
+ if ((bh = bread(MKDEV(MAJOR(devno), MINOR(devno)&~0xf), 0, block_size(devno))))
{
/* try to infer mapping from partition table */
ret_code = partsize (bh, (unsigned long) size, (unsigned int *) geom + 2,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:13    [W:0.903 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site