From: "Bryan O'Sullivan" <bos@serpentine.com>
To: Anders Henke <anders.henke@sysiphus.de>
Cc: linux-kernel@vger.kernel.org, peter@chubb.wattle.id.au
Subject: Re: using 2 TB in real life
Date: 12 Dec 2002 11:03:10 -0800 [thread overview]
Message-ID: <1039719790.11897.9.camel@plokta.s8.com> (raw)
In-Reply-To: <20021212174814.GA18993@schlund.de>
[-- Attachment #1: Type: text/plain, Size: 693 bytes --]
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
[-- Attachment #2: Type: text/plain, Size: 762 bytes --]
--- 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 */
next prev parent reply other threads:[~2002-12-12 18:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-12 11:12 Anders Henke
2002-12-12 12:03 ` Mike Black
2002-12-12 17:22 ` Bryan O'Sullivan
2002-12-12 17:48 ` Anders Henke
2002-12-12 19:03 ` Bryan O'Sullivan [this message]
2002-12-12 23:15 Andries.Brouwer
2002-12-13 14:43 ` Anders Henke
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=1039719790.11897.9.camel@plokta.s8.com \
--to=bos@serpentine.com \
--cc=anders.henke@sysiphus.de \
--cc=linux-kernel@vger.kernel.org \
--cc=peter@chubb.wattle.id.au \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome