Re: using STATUS_MORE_PROCESSING_REQUIRED: am I usin--g it correctly??

Yes this is correct. However, replace “I returned from the completion
routine” with “I returned from the dispatch routine.” I think that is
clearer.

The way the optimization works is the “IO Manager” (ZwXxxFile) calls
IopCompleteRequest if IRP_DEFER_IO_COMPLETION is set and the highest level
dispatch routine returned ANY status code EXCEPT STATUS_PENDING.
IoCompleteRequest knows NOT to queue the IopCompleteRequest APC if
Irp->PendingReturned is FALSE and IRP_DEFER_IO_COMPLETION is set.

-----Original Message-----
From: Smith, Joel [mailto:xxxxx@ntpsoftware.com]
Sent: Tuesday, August 01, 2000 3:15 PM
To: File Systems Developers
Subject: [ntfsd] Re: using STATUS_MORE_PROCESSING_REQUIRED: am I usin g it
correctly??

My understanding of the STATUS_MORE_PROCESSING_REQUIRED is as
follows:

  • For inherently synchronous io (such as creates) the io manager has an
    optimization that will allow a request to be completed without the posting
    of a special kernel APC to the requesting thread. IoCompleteRequest usually
    posts this request after calling the completion routines and the APC
    executes IopCompleteRequest which, among other things, tears down the irp.
    For inherently synchronous IO, IoCompleteRequest will not post the apc, but
    simply returns to the caller. Then, code in the io manager will call
    IopCompleteRequest directly. The problem is, in the latter case, the io
    manager will call IopCompleteRequest whether or not
    STATUS_MORE_PROCESSING_REQUIRED was returned from someones completion
    routine. Later, when the guy who returned STATUS_MORE_PROCESSING_REQUIRED
    tries to touch the irp (because he think he successfully halted completion)
  • KABLOOEY! The irp has already been torn down.

I think I am immune to this bug because I only access the irp within
the my dispatch routine, and the irp would not be torn down until after I
returned from the completion routine (when IopCompleteRequest is called by
the code that called my dispatch routine in the first place). If I were
posting the irp to a background thread for further processing, then there
would be a problem.

Am I correct in assuming I am excempt from the
STATUS_MORE_PROCESSING_REQUIRED/inherently synchronous io bug in this case?

Thanks,
Joel

-----Original Message-----
From: Maxim S. Shatskih [ mailto:xxxxx@storagecraft.com
mailto:xxxxx ]
Sent: Tuesday, August 01, 2000 3:12 PM
To: File Systems Developers
Subject: [ntfsd] Re: using STATUS_MORE_PROCESSING_REQUIRED: am I using
it correctly??

using STATUS_MORE_PROCESSING_REQUIRED: am I using it
correctly??>STATUS_MORE_PROCESSING_REQUIRED. Here is some code, with all
>of the irrelevant domain specific stuff stripped out. Am I doing this
right?

I would say - wrong a bit.
1) Wait always, regardless of the return code from IoCallDriver.
2) Call IoMarkIrpPending before IoCallDriver, and always return
STATUS_PENDING from your dispatch routine. See Nagar’s book for details -
“About STATUS_MORE_PROCESSING_REQUIRED stuff”.

Max


You are currently subscribed to ntfsd as: xxxxx@ntpsoftware.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)</mailto:xxxxx>