lkml.org 
[lkml]   [2008]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/5] pagemap: Make pagemap_read enforce reading in multiples of 8
From
Date

On Thu, 2008-06-05 at 12:14 -0400, Thomas Tuttle wrote:
> On Thu, Jun 5, 2008 at 12:09 PM, Matt Mackall <mpm@selenic.com> wrote:
> > Yes, I got that, I'm just mathematically impaired this morning. Read
> > that as "when someone tries to do a *20* byte read, do a 16-byte read.."
> > In other words, round down to the nearest multiple of 8.
>
> Oh. I would seriously question doing that, because it would allow
> reads that are improperly split up to fail silently. What happens if
> someone tries to read 40 bytes, and (for some reason) it gets split
> into two 20-byte reads? Instead of "12345" they'll get "12.34."
> (where . is 4 zero or garbage bytes). I'd rather they get an error.

I suppose you're right, people usually don't check those return codes.

--
Mathematics is the supreme nostalgia of our time.



\
 
 \ /
  Last update: 2008-06-05 18:25    [W:0.031 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site