public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PATCH: Support tera byte disk
@ 2002-09-18 20:11 H. J. Lu
  2002-09-18 20:32 ` Andreas Dilger
  0 siblings, 1 reply; 5+ messages in thread
From: H. J. Lu @ 2002-09-18 20:11 UTC (permalink / raw)
  To: linux kernel

[-- Attachment #1: Type: text/plain, Size: 211 bytes --]

For a 1.8TB SCSI HD, kernel reports:

SCSI device sda: -773086208 512-byte hdwr sectors (-395819 MB)

Here is a patch to fix it. BTW, I don't think it will work with > 2TB,
which requires bigger changes.


H.J.

[-- Attachment #2: linux-2.4.18-tera.patch --]
[-- Type: text/plain, Size: 1155 bytes --]

--- linux-2.4.18-14.2/drivers/scsi/sd.c.tera	Wed Sep 18 11:55:53 2002
+++ linux-2.4.18-14.2/drivers/scsi/sd.c	Wed Sep 18 12:42:36 2002
@@ -1018,8 +1018,16 @@ static int sd_init_onedisk(int i)
 			 * Jacques Gelinas (Jacques@solucorp.qc.ca)
 			 */
 			int m;
-			int hard_sector = sector_size;
-			int sz = rscsi_disks[i].capacity * (hard_sector/256);
+			unsigned hard_sector = sector_size;
+			unsigned sz = rscsi_disks[i].capacity * (hard_sector/256);
+
+			/* Check for overflow.  */
+			if (sz < rscsi_disks[i].capacity) {
+				sz = (rscsi_disks[i].capacity/1950) * (hard_sector/256);
+				sz = sz/2 - sz/1250 + 974;
+			}
+			else
+				sz = (sz/2 - sz/1250 + 974)/1950;
 
 			/* There are 16 minors allocated for each major device */
 			for (m = i << 4; m < ((i + 1) << 4); m++) {
@@ -1027,9 +1035,9 @@ static int sd_init_onedisk(int i)
 			}
 
 			printk("SCSI device %s: "
-			       "%d %d-byte hdwr sectors (%d MB)\n",
+			       "%u %u-byte hdwr sectors (%u MB)\n",
 			       nbuff, rscsi_disks[i].capacity,
-			       hard_sector, (sz/2 - sz/1250 + 974)/1950);
+			       hard_sector, sz);
 		}
 
 		/* Rescale capacity to 512-byte units */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: Support tera byte disk
  2002-09-18 20:11 PATCH: Support tera byte disk H. J. Lu
@ 2002-09-18 20:32 ` Andreas Dilger
  2002-09-18 22:23   ` Bryan O'Sullivan
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Dilger @ 2002-09-18 20:32 UTC (permalink / raw)
  To: H. J. Lu; +Cc: linux kernel

On Sep 18, 2002  13:11 -0700, H. J. Lu wrote:
> For a 1.8TB SCSI HD, kernel reports:
> 
> SCSI device sda: -773086208 512-byte hdwr sectors (-395819 MB)
> 
> Here is a patch to fix it. BTW, I don't think it will work with > 2TB,
> which requires bigger changes.

There's also a limit where statfs() overflows at 16TB for 4kB block
filesystems...  Ask me how I noticed this ;-)

Luckily, it is easy to upshift f_blksz and downshift f_blocks, f_bfree,
and f_bavail to get the data through the statfs interface, and df does
the reverse on the other side.  It makes sense to show a larger block
size anyways, so apps potentially do larger I/O requests.

Cheers, Andreas
--
Andreas Dilger
http://www-mddsp.enel.ucalgary.ca/People/adilger/
http://sourceforge.net/projects/ext2resize/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: Support tera byte disk
  2002-09-18 20:32 ` Andreas Dilger
@ 2002-09-18 22:23   ` Bryan O'Sullivan
  2002-09-18 22:41     ` Andreas Dilger
  0 siblings, 1 reply; 5+ messages in thread
From: Bryan O'Sullivan @ 2002-09-18 22:23 UTC (permalink / raw)
  To: Andreas Dilger; +Cc: H. J. Lu, linux kernel

On Wed, 2002-09-18 at 13:32, Andreas Dilger wrote:

> There's also a limit where statfs() overflows at 16TB for 4kB block
> filesystems...  Ask me how I noticed this ;-)

Well, the whole world goes pear-shaped on ia32 with >16TB filesystems,
so statfs is the least of your worries in that case :-(

	<b

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: Support tera byte disk
  2002-09-18 22:23   ` Bryan O'Sullivan
@ 2002-09-18 22:41     ` Andreas Dilger
  2002-09-19 10:33       ` Mike Black
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Dilger @ 2002-09-18 22:41 UTC (permalink / raw)
  To: Bryan O'Sullivan; +Cc: H. J. Lu, linux kernel

On Sep 18, 2002  15:23 -0700, Bryan O'Sullivan wrote:
> On Wed, 2002-09-18 at 13:32, Andreas Dilger wrote:
> 
> > There's also a limit where statfs() overflows at 16TB for 4kB block
> > filesystems...  Ask me how I noticed this ;-)
> 
> Well, the whole world goes pear-shaped on ia32 with >16TB filesystems,
> so statfs is the least of your worries in that case :-(

Why do you say that?  I've been testing with 60TB or larger filesystems
all week ;-).  Note that we can use more than a single block device
and/or remote storage target to store data, so block device limits are
not applicable to us, although 16TB files are a limit we will hit soon.

Cheers, Andreas
--
Andreas Dilger
http://www-mddsp.enel.ucalgary.ca/People/adilger/
http://sourceforge.net/projects/ext2resize/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: Support tera byte disk
  2002-09-18 22:41     ` Andreas Dilger
@ 2002-09-19 10:33       ` Mike Black
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Black @ 2002-09-19 10:33 UTC (permalink / raw)
  To: Andreas Dilger, Bryan O'Sullivan; +Cc: H. J. Lu, linux kernel

Ummm...could you edumacate us on how one constructs a 60TB file system on IA32???
I thought 2TB was the limit.
I'm particularly interested if this is RAID too (I'm a RAID5 fan).
I'm trying to avoid NAS for my next file system upgrade.

----- Original Message ----- 
From: "Andreas Dilger" <adilger@clusterfs.com>
To: "Bryan O'Sullivan" <bos@serpentine.com>
Cc: "H. J. Lu" <hjl@lucon.org>; "linux kernel" <linux-kernel@vger.kernel.org>
Sent: Wednesday, September 18, 2002 6:41 PM
Subject: Re: PATCH: Support tera byte disk


> On Sep 18, 2002  15:23 -0700, Bryan O'Sullivan wrote:
> > On Wed, 2002-09-18 at 13:32, Andreas Dilger wrote:
> > 
> > > There's also a limit where statfs() overflows at 16TB for 4kB block
> > > filesystems...  Ask me how I noticed this ;-)
> > 
> > Well, the whole world goes pear-shaped on ia32 with >16TB filesystems,
> > so statfs is the least of your worries in that case :-(
> 
> Why do you say that?  I've been testing with 60TB or larger filesystems
> all week ;-).  Note that we can use more than a single block device
> and/or remote storage target to store data, so block device limits are
> not applicable to us, although 16TB files are a limit we will hit soon.
> 
> Cheers, Andreas
> --
> Andreas Dilger
> http://www-mddsp.enel.ucalgary.ca/People/adilger/
> http://sourceforge.net/projects/ext2resize/
> 
> -
> 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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-09-19 10:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-18 20:11 PATCH: Support tera byte disk H. J. Lu
2002-09-18 20:32 ` Andreas Dilger
2002-09-18 22:23   ` Bryan O'Sullivan
2002-09-18 22:41     ` Andreas Dilger
2002-09-19 10:33       ` Mike Black

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox