All of lore.kernel.org
 help / color / mirror / Atom feed
From: Erik Andersen <andersen@codepoet.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Marcelo Tosatti <marcelo@conectiva.com.br>
Subject: [PATCH] fix SCSI non-blocksize reads
Date: Fri, 23 Nov 2001 17:04:46 -0700	[thread overview]
Message-ID: <20011123170446.A18275@codepoet.org> (raw)
In-Reply-To: <20011122102054.A11961@codepoet.org> <Pine.LNX.4.33.0111221039530.1479-100000@penguin.transmeta.com>
In-Reply-To: <Pine.LNX.4.33.0111221039530.1479-100000@penguin.transmeta.com>

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,

      reply	other threads:[~2001-11-24  0:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-22  6:44 Linux-2.4.15-pre9 Linus Torvalds
2001-11-22  7:47 ` Linux-2.4.15-pre9 Anuradha Ratnaweera
2001-11-22 18:52   ` Linux-2.4.15-pre9 Linus Torvalds
2001-11-22 19:34     ` Linux-2.4.15-pre9 Alexander Viro
2001-11-22 19:46       ` Linux-2.4.15-pre9 Tom Rini
2001-11-23 16:20     ` Linux-2.4.15-pre9 Michael H. Warfield
2001-11-26 11:52     ` PATCH 2.5.0 kill read_ahead array Martin Dalecki
2001-11-26 16:34       ` Andreas Dilger
2001-11-26 16:53         ` Martin Dalecki
2001-11-22 19:16   ` Linux-2.4.15-pre9 Tim Schmielau
2001-11-26 15:18   ` Linux-2.4.15-pre9 bill davidsen
2001-11-22  8:41 ` [PATCH] fix SCSI non-blocksize reads Erik Andersen
2001-11-22 17:09   ` Linus Torvalds
2001-11-22 17:20     ` Erik Andersen
2001-11-22 18:40       ` Linus Torvalds
2001-11-24  0:04         ` Erik Andersen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011123170446.A18275@codepoet.org \
    --to=andersen@codepoet.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.