Re: IoMarkIrpPending issue
- From: "Doron Holan [MS]" <doronh@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 24 May 2006 08:07:36 -0700
you can makr the irp pending right after 1). once you call
IoMarkIrpPending, you must return STATUS_PENDING, which you are doing in 10)
so you are OK. makring the irp pending at the top of the function
simplifies things abit for you.
d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Bob" <Bob@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:723F1F42-F307-4FEC-A2E5-34D838D4CE62@xxxxxxxxxxxxxxxx
My driver is a logical volume driver (e.g. mirroring).
Each logical volume is made up of one or more disk partitions.
The general flow of a read request is as follows:
1) Driver receives a 'logical' I/O request (VolIrp).
(This request may (or may not) translate into multiple
physical I/Os)
2) Driver packages up the I/O request info into a generic
format (VolIo).
3) Driver Passes the VolIo to common code (volume manager).
4) Common code process the VolIo request and generates
one or more physical I/Os (PhysIo)
5) Common code calls the driver to initiate the PhysIo(s).
6) Driver code allocates Irp(s) and Mdl(s) for each PhysIo
7) Driver set an IoCompletionRoutine for each request
8) Driver initiates each I/O with IoCallDriver
9) Driver calls IoMarkIrpPending for VolIrp (logical I/O)
10) Driver returns STATUS_PENDING
< some time later >
11) The Driver I/O completion routine for each PhysIrp collects
some statistics, frees the Mdl, frees the Irp and if
it is the last (or only) PhysIrp generated from the
original VolIrp, it calls IoCompleteRequest for
VolIrp.
The problem I'm having is that _sometimes_ step 11 happens before
step 9 (e.g. for a cached I/O?). When that happens IoMarkIrpPending
gets called on an Irp that has already been completed. (not good)
Question: is there a standard way to handle this or do I need to add
my own synchonization event for each (logical) I/O? (not good either...)
Thanks in advance.
.
- Follow-Ups:
- Re: IoMarkIrpPending issue
- From: Bob
- Re: IoMarkIrpPending issue
- Prev by Date: Re: HOWTO: Using .Det sections
- Next by Date: Re: KMDF 1.1 and ReadFile requests to multiply USB pipes
- Previous by thread: Re: IoMarkIrpPending issue
- Next by thread: Re: IoMarkIrpPending issue
- Index(es):
Relevant Pages
|