“Ravisankar Pudipeddi” writes:
> Creates are inherently synchronous today. I/O manager does a
> non-alertable wait on creates if you return pending. So creates are
> non-cancellable on thread exit. The solution is not to have a
> high-latency create: NT in general does not tolerate high-latency creates
> well for a variety of reasons.
>
> You need to let creates go through /fail, and postpone your processing as
> needed (maybe on first read/write?)
>
Unfortunately, this is not a good option with global, networked
filesystems. For example, the path lookup itself needs to be completed,
which might take a lot of time. There is a possibility of multiple timeouts
+ failovers etc in the process.
Is there any way to get around this, is the pending thread exit recorded
in the thread state, so that it’s pollable? Any other ways to notice the
pending thread exit before the create is completed? Are Yuedong’s ideas
workable?
Thanks
/Tomas
> -----Original Message-----
> From: xxxxx@math.uic.edu [mailto:xxxxx@math.uic.edu]
> Sent: Tuesday, April 30, 2002 5:11 PM
> To: File Systems Developers
> Subject: [ntfsd] Re: How to make a cancellable IRP_MJ_CREATE in the process termination.
>
>
> The issue here is a pending IRP_MJ_CREATE’s cancel routine does not get invoked in process termination. For other pending irp which has set with cancel routine, that cancel proc will get called. I am sure that new cancel safe queue have nothing to do with this.
>
> Yuedong.
> > For your create IRP, you can use the new cancel safe queue functions
> > on XP to manage cancelation. There is a sample in the DDK called
> > cancel that demonstrates how to do this.
> >
> > -Sebastien
> >
> > >From: xxxxx@math.uic.edu
> > >Reply-To: “File Systems Developers”
> > >To: “File Systems Developers”
> > >Subject: [ntfsd] How to make a cancellable IRP_MJ_CREATE in the
> > >process termination.
> > >Date: Tue, 30 Apr 2002 14:08:25 -0400
> > >
> > >My FS driver is doing some lengthy work on create in some case so I
> > >actually queue it into a worker thread. If user want to exit that
> > >application which initially send down the IRP_MJ_CREATE, how can I
> > >get this IRP cancelled? I have marked the IRP cancelllable, it seems
> > >that Cancel routine does not get called for IRP_MJ_CREATE. Can
> > >somebody help me with cleanup sequence of process? I have several
> > >option to try, though I do not know which one would work.
> > >1) Try to issue a pending READ or WRITE Irp in the context of that
> > >original process before I queue IRP_MJ_CREATE. If that READ/WRITE
> > >Irp’s cancel routine can be called in the process termination, then
> > >problem is solved.
> > >2) Hook into system call(NtTerminateProcess) and call down to my
> > >driver to cancel that IRP_MJ_CREATE.
> > >
> > >Can anybody shed some light on this problem?
> > >
> > >Thanks
> > >