Re: [PATCH] scsi/sd: Fix size output in MB

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: James Bottomley <James.Bottomley@...>
Cc: Simon Arlott <simon@...>, Linux Kernel Mailing List <linux-kernel@...>, linux-scsi <linux-scsi@...>
Date: Saturday, August 30, 2008 - 1:45 pm

On Sat, Aug 30, 2008 at 12:24:50PM -0500, James Bottomley wrote:


I was looking at this code recently because it looks really bizarre when
you create a half-petabyte filesystem:

$ sudo insmod drivers/ata/ata_ram.ko capacity=1099511627776 preallocate=0

[12095.028093] ata7.00: 1099511627776 sectors, multi 0: LBA48 NCQ (depth 31/32)
[12095.028093] ata7.00: configured for UDMA/133
[12095.041915] scsi 7:0:0:0: Direct-Access     ATA      Linux RAM Drive 0.01 PQ: 0 ANSI: 5
[12095.041915] sd 7:0:0:0: [sdc] Very big device. Trying to use READ CAPACITY(16).
[12095.041915] sd 7:0:0:0: [sdc] 1099511627776 512-byte hardware sectors (562949953 MB)
[12095.041915] sd 7:0:0:0: [sdc] Write Protect is off
[12095.041915] sd 7:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA

1. Avoiding 64-bit divisions is _so_ last decade.  We have
linux/math64.h, we should use it.

2. We should report in GB or TB when appropriate.  The exact definition
of 'appropriate' is going to vary from person to person.  Might I
suggest that we should report between two and four significant digits.
eg 9543 MB is ok, 10543 MB should be 10 GB.

3. I hate myself for saying this ... but maybe we should be using the
horrific MiB/GiB/TiB instead of MB/GB/TB.

4. I've been far too busy to write said patch.  Simon, would you mind
doing the honours?

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] scsi/sd: Fix size output in MB, Simon Arlott, (Sat Aug 30, 10:08 am)
Re: [PATCH] scsi/sd: Fix size output in MB, James Bottomley, (Sat Aug 30, 1:24 pm)
Re: [PATCH] scsi/sd: Fix size output in MB, Matthew Wilcox, (Sat Aug 30, 1:45 pm)
Re: [PATCH] scsi/sd: Fix size output in MB, Simon Arlott, (Sat Aug 30, 5:02 pm)
Re: [PATCH] scsi/sd: Fix size output in MB, Matthew Wilcox, (Sat Aug 30, 5:57 pm)
Re: [PATCH] scsi/sd: Fix size output in MB, James Smart, (Sun Aug 31, 8:27 am)
Re: [PATCH] scsi/sd: Fix size output in MB, Simon Arlott, (Sat Aug 30, 6:22 pm)
Re: [PATCH] scsi/sd: Fix capacity output to show MB/GB/TB/..., James Bottomley, (Sun Aug 31, 11:08 am)
[PATCH] mmc_block: use generic helper to print capacities, Pierre Ossman, (Sun Aug 31, 2:54 pm)
Re: [PATCH] scsi/sd: Fix size output in MB, Pierre Ossman, (Sat Aug 30, 4:59 pm)
Re: [PATCH] scsi/sd: Fix size output in MB, James Bottomley, (Sat Aug 30, 5:45 pm)
Re: [PATCH] scsi/sd: Fix size output in MB, Pierre Ossman, (Sat Aug 30, 6:13 pm)
Re: [PATCH] scsi/sd: Fix size output in MB, Matthew Wilcox, (Sat Aug 30, 6:36 pm)
Re: [PATCH] scsi/sd: Fix size output in MB, Simon Arlott, (Sat Aug 30, 6:24 pm)