On Thu, 12 Feb 2015 15:25:08 -0800 James Bottomley 
<james.bottom...@hansenpartnership.com> wrote:

> On Thu, 2015-02-12 at 15:01 -0800, a...@linux-foundation.org wrote:
> > From: Rasmus Villemoes <li...@rasmusvillemoes.dk>
> > Subject: lib/string_helpers.c:string_get_size(): remove redundant prefixes
> > 
> > While 3c9f3681d0b4 "[SCSI] lib: add generic helper to print sizes rounded
> > to the correct SI range" says that Z and Y are included in preparation for
> > 128 bit computers, they just waste .text currently.  If and when we get
> > u128, string_get_size needs updating anyway (and ISO needs to come up with
> > four more prefixes).
> 
> This is rubbish. It's nothing to do with 128 bits.  This is to do with
> disk sizes linux gets attached to.  The current largest device clusters
> are Petabytes ... I think we may have some exabyte ones somewhere in the
> Academic community, so it's by no means inconcievable we'll have
> Zettabyte ones within a few years.  The SCSI standard, with 4k blocks
> supports up to 2^76, which is well into Zettabytes.  We obviously run
> off the mmap possibilities a lot sooner, because of the byte offsets,
> but that's fixable.  Someone will probably start first by passing blocks
> into that interface not bytes, so we'd like it not to be based on
> assumptions that think 2^64 is the largest possible value.

I don't get it.  As the man says, this is presently dead code and
string_get_size() will need to be changed to work for disks larger than
2^64 bytes.  That change may be to take a u128 or it may be as you
suggest: replace the `u64 size' with `u64 size, u64 units' which is
effectively the same thing.

> > Also there's no need to include and test for the NULL sentinel; once we
> > reach "E" size is at most 18.  [The test is also wrong; it should be
> > units_str[units][i+1]; if we've reached NULL we're already doomed.]
> 
> So fix the bug, don't set us up to run off the end of the array.  And
> please consult the community which keeps track of this rather than
> trying to get it into Linux without review.

That seems a bit harsh - you've been cc'ed on this every step of the way.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to