IO Deadlock - File Close blocked by IRP_MJ_CREATE

I have a client that is opening a file. In the mini filter PreCreate for the
IRP_MJ_CREATE I FltSendMessage to my background application that rewrites
the file that is being opened. Ocassionally my background application blocks
while closing the file. Is there a way I can make this work in all cases ?

I need the close to not block, so that the FltSendMessage completes so that
the PreCreate function returns.

I do not have control over the IO used in the client application.

Richard T. Schaefer E-mail: xxxxx@RTS-Services.com

RTS Services Inc Web: http://www.RTS-Services.com
http:</http:>

7330 Cave Hollow ___ Voice: (512) 923-2755
Austin, TX 78750 | Fax: (830) 798-9644
`---------(*)---------’

The mini filter driver does ignore (Successfully return) all IO requests
from my background application.

So the client thread that initiated the IO, was blocked in the mini filters
PRECreate. How does this block other sequences of Open/Read/Wrtie/Closes to
happen on the same file ? Is there a way around it ?


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Richard T. Schaefer
Sent: Saturday, August 23, 2008 8:37 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IO Deadlock - File Close blocked by IRP_MJ_CREATE

I have a client that is opening a file. In the mini filter PreCreate for the
IRP_MJ_CREATE I FltSendMessage to my background application that rewrites
the file that is being opened. Ocassionally my background application blocks
while closing the file. Is there a way I can make this work in all cases ?

I need the close to not block, so that the FltSendMessage completes so that
the PreCreate function returns.

I do not have control over the IO used in the client application.

Richard T. Schaefer E-mail: xxxxx@RTS-Services.com

RTS Services Inc Web: http://www.RTS-Services.com
http:</http:>

7330 Cave Hollow ___ Voice: (512) 923-2755
Austin, TX 78750 | Fax: (830) 798-9644
`---------(*)---------’


NTFSD is sponsored by OSR

For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Maybe I should backup and question the strategy:

Is the model of conditionally modifying a file, by trapping the (PRE) open
request to the file from a mini-filter driving, frought with problems.


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Richard T. Schaefer
Sent: Saturday, August 23, 2008 9:51 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] IO Deadlock - File Close blocked by IRP_MJ_CREATE

The mini filter driver does ignore (Successfully return) all IO requests
from my background application.

So the client thread that initiated the IO, was blocked in the mini filters
PRECreate. How does this block other sequences of Open/Read/Wrtie/Closes to
happen on the same file ? Is there a way around it ?


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Richard T. Schaefer
Sent: Saturday, August 23, 2008 8:37 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IO Deadlock - File Close blocked by IRP_MJ_CREATE

I have a client that is opening a file. In the mini filter PreCreate for the
IRP_MJ_CREATE I FltSendMessage to my background application that rewrites
the file that is being opened. Ocassionally my background application blocks
while closing the file. Is there a way I can make this work in all cases ?

I need the close to not block, so that the FltSendMessage completes so that
the PreCreate function returns.

I do not have control over the IO used in the client application.

Richard T. Schaefer E-mail: xxxxx@RTS-Services.com

RTS Services Inc Web: http://www.RTS-Services.com
http:</http:>

7330 Cave Hollow ___ Voice: (512) 923-2755
Austin, TX 78750 | Fax: (830) 798-9644
`---------(*)---------’


NTFSD is sponsored by OSR

For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


NTFSD is sponsored by OSR

For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

There is insuficient info. There shouldn’t be lock because create and close use different FO. Try to investigate problem with kernel debugger. Use !stacks or !process. Stack of close in progress should say more. I suspect some filter might hold lock.
-bg