asynchronous writes to a disk, using FILE_FLAG_OVERLAPPED

Hi,
I have a problem with asynchronous writes to a disk, when the data
itself is overlapped. Example: write from offset 100 to 200, then write
from 150 to 250. (Of course, I’m not waiting for a reply between writes).
My environment is W2K, NTFS.
I’m using Createfile with the FILE_FLAG_OVERLAPPED flag. User mode.
Using Writefile command to write to the disk.
When data is overlapped I get the wrong data (sometimes).
If I add the FILE_FLAG_NO_BUFFERING flag, the problem is solved.
Questions:

  1. When using asynchronous writes, am I allowed to overlap the data. In other
    words, does the filesystem guarantee that the order of the writes is kept ?
  2. From my experience, the FILE_FLAG_NO_BUFFERING solves the problem. Can I rely
    on it for all situations. In other words, does this force the filesystem to keep
    the correct order of the writes, which will allow the overlapping of data in
    aynchronous mode.
  3. Do writes, as described above: anynchronous with data overlapping, actually
    occur in applications ? Maybe databases ?
  4. I have a feeling that even without the FILE_FLAG_NO_BUFFERING flag, the above
    scenario should work.
    Thanks, Mike

This mail was sent via storeage.com

************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************

>I have a problem with asynchronous writes to a disk, when the data

itself is overlapped. Example: write from offset 100 to 200, then write
from 150 to 250

Maybe remaking an app is a better idea? Very strange pattern.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

I agree its a strange pattern, but its just an example of what may happen.
One of my questions is: while a database, for example, is issuing asynchronous writes,
is it possible that the writes may overlap ?
Mike

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Sunday, January 23, 2005 16:18
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] asynchronous writes to a disk, using
FILE_FLAG_OVERLAPPED

I have a problem with asynchronous writes to a disk, when the data
itself is overlapped. Example: write from offset 100 to 200, then write
from 150 to 250

Maybe remaking an app is a better idea? Very strange pattern.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@storeage.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

*** IMPORTANT: Do not open attachments from unrecognized senders ***

******************************************************************************************
The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or the
sender immediately and do not disclose the contents to any one or make copies.

******************************************************************************************

************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************

This mail was sent via storeage.com

************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************

If you need to be sure requests would be completed in the order you’ve fired
them you need to provide own serialization
mechanism (usually holding n + 1 request before n would not be completed).
There are too many places in storage stack
(including controller driver, controller firmware and hard drive firmware)
where requests could be reordered.

Regards,
Anton Kolomyeytsev

CEO, Rocket Division Software

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mike Penn
Sent: Sunday, January 23, 2005 5:40 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] asynchronous writes to a disk, using
FILE_FLAG_OVERLAPPED

I agree its a strange pattern, but its just an example of what may happen.
One of my questions is: while a database, for example, is issuing
asynchronous writes, is it possible that the writes may overlap ?
Mike

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Sunday, January 23, 2005 16:18
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] asynchronous writes to a disk, using
FILE_FLAG_OVERLAPPED

I have a problem with asynchronous writes to a disk, when the data
itself is overlapped. Example: write from offset 100 to 200, then write
from 150 to 250

Maybe remaking an app is a better idea? Very strange pattern.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@storeage.com To unsubscribe
send a blank email to xxxxx@lists.osr.com

*** IMPORTANT: Do not open attachments from unrecognized senders ***

****************************************************************************
**************
The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or
the sender immediately and do not disclose the contents to any one or make
copies.

****************************************************************************
**************

****************************************************************************
********
This footnote confirms that this email message has been scanned by PineApp
Mail-SeCure for the presence of malicious code, vandals & computer viruses.
****************************************************************************
********

This mail was sent via storeage.com

****************************************************************************
********
This footnote confirms that this email message has been scanned by PineApp
Mail-SeCure for the presence of malicious code, vandals & computer viruses.
****************************************************************************
********


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Each write writes its own blocks.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Mike Penn”
To: “Windows File Systems Devs Interest List”
Sent: Sunday, January 23, 2005 6:39 PM
Subject: RE: [ntfsd] asynchronous writes to a disk, using FILE_FLAG_OVERLAPPED

I agree its a strange pattern, but its just an example of what may happen.
One of my questions is: while a database, for example, is issuing asynchronous
writes,
is it possible that the writes may overlap ?
Mike

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Sunday, January 23, 2005 16:18
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] asynchronous writes to a disk, using
FILE_FLAG_OVERLAPPED

>I have a problem with asynchronous writes to a disk, when the data
>itself is overlapped. Example: write from offset 100 to 200, then write
>from 150 to 250

Maybe remaking an app is a better idea? Very strange pattern.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@storeage.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

IMPORTANT: Do not open attachments from unrecognized senders

********************************************************************

The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or
the
sender immediately and do not disclose the contents to any one or make copies.

********************************************************************


**************************************************************************

This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer
viruses.
**************************************************************************


This mail was sent via storeage.com

**************************************************************************

This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer
viruses.
**************************************************************************



Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com