How to complete a SCSIOP_WRITE correctly in a virtual disk (bus) driver?

I have a virtual disk bus driver. It’s working perfectly, but I have the
following strange behavior. I mount the disk, copy a large data to the disk,
I wait, I can see the driver copied the whole data, then I unmount it. And
… It starts copying the data again, and then again (2x). And then the disk
is unmounted.

I think I miss something with the cache management. Should I return
something to tell the disk driver to disable the write cache? In the
disk.sys ClassBuildRequest is playing with the SrbFlags
(SRB_FLAGS_ADAPTER_CACHE_ENABLE) and with cdb->CDB10.ForceUnitAccess.

When I complete the SCSIOP_WRITE I write the data to my storage and set the
status and SrbStatus to STATUS_SUCCESS and IoInformation to
WriteBufferLength.

What am I missing there?

Zoltan


Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You do not deal with cache management at block device driver level, only at
file system driver level. You may wish to force file system flush the data
before trying to unmount the volume.

Anton

On 11/08/01, “” wrote:
> I have a virtual disk bus driver. It’s working perfectly, but I have the
> following strange behavior. I mount the disk, copy a large data to the disk,
> I wait, I can see the driver copied the whole data, then I unmount it. And
> … It starts copying the data again, and then again (2x). And then the disk
> is unmounted.
>
> I think I miss something with the cache management. Should I return
> something to tell the disk driver to disable the write cache? In the
> disk.sys ClassBuildRequest is playing with the SrbFlags
> (SRB_FLAGS_ADAPTER_CACHE_ENABLE) and with cdb->CDB10.ForceUnitAccess.
>
> When I complete the SCSIOP_WRITE I write the data to my storage and set the
> status and SrbStatus to STATUS_SUCCESS and IoInformation to
> WriteBufferLength.
>
> What am I missing there?
>
> Zoltan
>
>
>
> _________________________________________________________
>
> Do You Yahoo!?
>
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>
>
> —
> You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Yes you do if the cache is in the hardware or in your virtual SCSI
drivers buffers. Most modern-day disk drives have built in caching.
SRB_ADAPTER_CACHE_ENABLE is for this purpose.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Friday, November 09, 2001 6:31 AM
To: NT Developers Interest List
Subject: [ntdev] Re: How to complete a SCSIOP_WRITE correctly in a
virtual disk (bus) driver?

You do not deal with cache management at block device driver level, only
at
file system driver level. You may wish to force file system flush the
data
before trying to unmount the volume.

Anton

On 11/08/01, “” wrote:
> I have a virtual disk bus driver. It’s working perfectly, but I have
> the following strange behavior. I mount the disk, copy a large data to

> the disk, I wait, I can see the driver copied the whole data, then I
> unmount it. And … It starts copying the data again, and then again
> (2x). And then the disk is unmounted.
>
> I think I miss something with the cache management. Should I return
> something to tell the disk driver to disable the write cache? In the
> disk.sys ClassBuildRequest is playing with the SrbFlags
> (SRB_FLAGS_ADAPTER_CACHE_ENABLE) and with cdb->CDB10.ForceUnitAccess.
>
> When I complete the SCSIOP_WRITE I write the data to my storage and
> set the status and SrbStatus to STATUS_SUCCESS and IoInformation to
> WriteBufferLength.
>
> What am I missing there?
>
> Zoltan
>
>
>
> _________________________________________________________
>
> Do You Yahoo!?
>
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
> unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

AFAIR Zoltan works with virtual SCSI hardware that does not do intermediate
caching.

Anton

Yes you do if the cache is in the hardware or in your virtual SCSI
drivers buffers. Most modern-day disk drives have built in caching.
SRB_ADAPTER_CACHE_ENABLE is for this purpose.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com