Virtual Disk Driver - Encryption/compression flag

Hi,

I am working on a virtual disk driver and found that

The NT cache manager at times deadlocks, if I use filesystem that uses
cache manager on the virtual disk and the virtual ndisk itself is stored
on a filesystem that also uses cache manager.

To avoid the deadlock I use FILE_NO_INTERMEDIATE_BUFFERING while
creating/opening virtual disk file. However if the virtual disk file is
compressed/encrypted the system caches the virtual disk file anyway, so
the above solution does not work with compressed/encrypted virtual disk
file.

Does any budy has faced similar problem or is there a better solution
available for this problem?

Regards
Mohan

On Wed, 15 Jul 2009, Mohan Bisht wrote:

To avoid the deadlock I use FILE_NO_INTERMEDIATE_BUFFERING while
creating/opening virtual disk file. However if the virtual disk file is
compressed/encrypted the system caches the virtual disk file anyway, so
the above solution does not work with compressed/encrypted virtual disk
file.

Does any budy has faced similar problem or is there a better solution
available for this problem?

Yes that is a well known problem with virtual disks and the solution is to
not allow the image file to be compressed or encrypted (however I think
that the deadlock only ocur when writing so you coud allow read-only mode)

If you absolutly want the image file to be compressed you coud in theory
open it in raw mode and decompress it your self to a private buffer, the
functions needed is parhaps undocumented but still available on the net.

Bo Branten

Thanks Braten,

Yes, you are right. We faced the deadlocks only with write operations.
I think we will go with the approach of disallowing compression/encryption for the time being.

Regards
Mohan

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Bo Brant?n
Sent: Wednesday, July 15, 2009 6:22 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Virtual Disk Driver - Encryption/compression flag

On Wed, 15 Jul 2009, Mohan Bisht wrote:

To avoid the deadlock I use FILE_NO_INTERMEDIATE_BUFFERING while
creating/opening virtual disk file. However if the virtual disk file
is compressed/encrypted the system caches the virtual disk file
anyway, so the above solution does not work with compressed/encrypted
virtual disk file.

Does any budy has faced similar problem or is there a better solution
available for this problem?

Yes that is a well known problem with virtual disks and the solution is to not allow the image file to be compressed or encrypted (however I think that the deadlock only ocur when writing so you coud allow read-only mode)

If you absolutly want the image file to be compressed you coud in theory open it in raw mode and decompress it your self to a private buffer, the functions needed is parhaps undocumented but still available on the net.

Bo Branten


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars (including our new fs mini-filter seminar) 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