Re: Re: [ntdev] Short reads on FSDs and disks

Yes Marion, any stream. However, we were discussing disks and file systems
for this particular thread, so I was trying to stay on topic.

On Tue, Jan 13, 2015 at 6:16 PM, Marion Bond wrote:

> In POSIX a file is a stream and any stream can legally give a short
> read. Correctly written code usually does not care if the stream is a file
> or a pipe or paper tape
>
> The Win32 API supports this construct as well, but there are certain
> design patterns that rely on the assumption that short reads do not occur
> and IIRC since Vista MSDN documentation changed to reflect the certainty of
> this behaviour as well as IOCP completion notifications and other stuff
> that previously had to be assumed to write performance application (think
> SQL server)
>
> Sent from Surface Pro
>
> From: Maxim S. Shatskih
> Sent: ‎Tuesday‎, ‎January‎ ‎13‎, ‎2015 ‎9‎:‎55‎ ‎AM
> To: Windows System Software Devs Interest List
>
> > So, if you’re sequentially reading through a file and you are returned
> less data than you asked for,
> >but you don’t get an “end of file” error, you just keep reading until you
> get zero bytes and an end of
> >file error??
>
> Yes. On POSIX, yes.
>
> At there are web resources where the developers are warned on this.
>
> My Linux bug was: I have some “chunk headers” inside the file.
>
> If EOF hits in the middle of the Nth chunk header, thus making the header
> truncated - then the file is corrupt.
>
> And my code was just reading ChunkHeaderSize and failing on a short read
> after, reporting the corrupt file.
>
> This seems (I’m now not sure even about this!) to be correct on Windows.
>
> But, on Linux, the OS can return a short read on my chunk header read, and
> then the valid file is considered to be broken. More so, this occurs only
> sometimes :slight_smile:
>
> All of this is related to Linux signals in some way. A signal can cause a
> short read.
>
> –
> Maxim S. Shatskih
> Microsoft MVP on File System And Storage
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Jamey Kirby
Disrupting the establishment since 1964

This is a personal email account and as such, emails are not subject to
archiving. Nothing else really matters.