EldoS | Feel safer!

Software components for data protection, secure storage and transfer

filecache bug?

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#18004
Posted: 10/26/2011 19:08:02
by Ben Schwarz (Standard support level)
Joined: 08/27/2011
Posts: 19

I am seeing a problem that manifests only when filecache is enabled. We get a callback for OnWriteFile with bytesToWrite equal to 0. This in itself isn't too terrible, but there is an assert in CbFsUcbWrite() which ends up being triggered and causes the CRT to shut down our filesystem (ASSERT(BytesToWrite > 0);).

The sequence of events which causes this particular issue are:

Code
- Application writes 44 bytes to a file at offset 0
   - We get a callback for SetEndOfFile = 44
- Application writes 3756 bytes at offset 44
   - We get a callback for SetEndOfFile = 3800
- Application writes 44 bytes at offset 0
   - No callback
- Application reads 3800 bytes at offset 0
   - No callback
- Application sets file pointer to 0
   - No callback
- Application sets end of file to 0
   - We get a callback for WriteFile offset=0, bytes=0
   - We get a callback for SetEndOfFile = 0


With file cache disabled the callbacks match what the application is doing and there is no write callback received with bytesToWrite=0.
#18013
Posted: 10/27/2011 09:41:28
by Volodymyr Zinin (EldoS Corp.)

Thanks. We will check it...

Reply

Statistics

Topic viewed 980 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!