I was imagining that all retrying would be done inside the driver and Error
basically means fatal permanent error ("disk exploded"). The only use I can
think of for partial successful writes is writing a manual select()-style
loop, but I figured we'd just write in a 'blocking style' and rely on
Lwt/Async.

Does that make sense? Have I missed something important?



On Sun, Dec 1, 2013 at 9:13 PM, Anil Madhavapeddy
<notifications@github.com>wrote:

> In lib/v1.ml:
>
> >        attempts to write the data contained within [buffers] to [t] starting
> > -      at [sector_start]. If an error occurs then the write may have partially
> > -      succeeded. *)
> > +      at [sector_start]. All writes are persisted before the IO operation
> > +      completes. If the IO operation fails with an error, then the write may
> > +      have partially succeeded.
>
> Doesn't Error also need to return how many bytes were written, as writeand
> writev do in POSIX? Otherwise, it's impossible to recover from a partial
> write. The backend also needs to guarantee that the buffer list is written
> in serial, so that the caller can resume from the correct point in the list
> when retrying.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/mirage/mirage-types/pull/2/files#r8015084>
> .
>



-- 
Dave Scott