Re: using 2 TB in real life

From: Bryan O'Sullivan (bos@serpentine.com)
Date: Thu Dec 12 2002 - 14:03:10 EST


On Thu, 2002-12-12 at 09:48, Anders Henke wrote:

> Peter's patch is not necessary for a 1.9TB device, but (from a quick
> glance at the source) should fix the display problem I mentioned.

No, my point was precisely that Peter's patch changes the display
problem into a different display problem. It will report a 1.9TB
filesystem as a 300MB filesystem, because some of the bit-shuffling is
wrong.

I've attached a patch which illustrates a fix to the SCSI device size
reporting problem in Peter's 2TB patch (the fix was found by HJ Lu). It
probably won't apply cleanly due to version drift (and of course it
definitely won't apply to a stock kernel), but it indicates what's
wrong.

        <b


--- linux-pchubb/drivers/scsi/sd.c Thu Dec 12 10:58:29 2002
+++ linux/drivers/scsi/sd.c Thu Dec 12 10:58:29 2002
@@ -1002,8 +1002,8 @@
                          */
                         int m;
                         unsigned hard_sector = sector_size;
- sector_t sz = rscsi_disks[i].capacity * (hard_sector/256);
- sector_t mb = sz >>= 1;
+ sector_t sz = ((sector_t) rscsi_disks[i].capacity) * ((sector_t) (hard_sector/256));
+ sector_t mb = sz >> 1;
                         sector_div(sz, 1250);
                         mb -= sz - 974;
                         
@@ -1015,9 +1015,9 @@
                         }
 
                         printk("SCSI device %s: "
- "%u %u-byte hdwr sectors (%u MB)\n",
+ "%u %u-byte hdwr sectors (%llu MB)\n",
                                nbuff, rscsi_disks[i].capacity,
- hard_sector, sz);
+ hard_sector, mb);
                 }
 
                 /* Rescale capacity to 512-byte units */

-
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/



This archive was generated by hypermail 2b29 : Sun Dec 15 2002 - 22:00:25 EST