This is where the undocumented intricacies of what happens at
snapshot time come to bite you.
The VOLSNAP_FLUSH_HOLD_WRITE ioctl only means what it says until it
reached the volsnap driver. On it’s way down it should trigger file
systems such as NTFS to do what it says on the tin, that is flush any
cached data and pend any writes from proceeding down the stack.
On the other hand, once it reaches volsnap all bets are off as to
what volsnap thinks it means compared to what you think it means.
This ioctl is generally a prelude to a snapshot and as such is
followed by a series of ioctls to volsnap that drive the snapshot
logic inside volsnap. As part of that logic volsnap may proceed to
write a large amount of data to the volume as it sets up the new
logical snapshot container. It may also have to delete an old
snapshot if it has run out of space. At a minimum volsnap keeps
track of the snapshot state by writing to certain logical sectors on
the volume.
As a volume filter driver you will see lots of writes generated
between the HOLD and RELEASE ioctls. Unless you really really know
what you are doing, stamping your own writes on the volume at this
time is liable to corrupt the volume.
Doing your own file I/O in a volume filter is not a great idea,
though I for various reasons I’ve done it myself. What you will
certainly have to ensure is that you do not generate any file i/o on
a volume that has had a HOLD but not a release issued on it.
HTH
Mark.
BTW - cross posting between NTDEV and NTFSD is frowned on.
At 06:54 20/11/2009, Vijay Pothireddy wrote:
HI every One,
I have observed some strange issue with volsnap driver and other
drivers when we do File system IO from a volume filter driver,
especially when we tried to do some FILE IO at the time of the
FLUSH_HOLD_WRITE IOCTL , ntfs should take care of this ?
Also if it is a mirror volume we are seeing the volume is getting
corrupted when we do some file system writes, I am very much puzzled here .
does some one help me here ?
Regards,
Vijay
NTDEV is sponsored by OSR
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