lockups again

I’m still struggling with a FSFD. My FSFD intercepts IRP_MJ_CREATE requests
and notifies user mode application and waits for its reply. The problem is
that sometimes when some application opens a file the whole user mode seems
to be stuck. So my UM client cannot continue until the file is opened and
the file cannot be opened until UM client replied. Target OS is NT4 SP6.

Is there any issues known or I should go for some bugs in my driver?

Alexey Logachyov
xxxxx@vba.com.by
VirusBlokAda ltd.
http://www.vba.com.by


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

Well, for one you shouldn’t block any IRP_MJ_CREATE requests generated
by the thread or threads in your application process that are handling
your filter driver requests, for obvious reasons (you can probably do
this by comparing pIrp->Tail.Overlay.Thread against a list of
application thread objects maintained by you). If you are careful not to
do this, then the remaining possibility is that your application is
blocked waiting on a different process that is waiting on a create. This
depends on what APIs your application is calling, and I’m not sure it is
possible to guarantee this won’t be the case for many APIs (some which
are implemented as calls to the csrss.exe process).

  • Nicholas Ryan

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Alexey Logachyov
Sent: Friday, January 11, 2002 4:55 AM
To: File Systems Developers
Subject: [ntfsd] lockups again

I’m still struggling with a FSFD. My FSFD intercepts IRP_MJ_CREATE
requests
and notifies user mode application and waits for its reply. The problem
is
that sometimes when some application opens a file the whole user mode
seems
to be stuck. So my UM client cannot continue until the file is opened
and
the file cannot be opened until UM client replied. Target OS is NT4 SP6.

Is there any issues known or I should go for some bugs in my driver?

Alexey Logachyov
xxxxx@vba.com.by
VirusBlokAda ltd.
http://www.vba.com.by


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


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

Couple of things:

  1. Check your own locking mechanizm that you use in your driver. Make sure
    there are no dead-locks or race conditions considering that app may call FS
    to satisfy your request.
  2. When you communicate with app, you use DevIoControl. And (as far as I
    remember) it’s sequential routine. Which means that within your process all
    calls to DevIoCtl (for same handle) will be satisfied in the sequence they
    were received. So, if there is a call that has not been yet completed all
    subsequent calls will not go through while the first one is pending.

Regards,

Vladimir

BTW: What would happened if I “accidentaly” block paging I/O on a shared
lock. Scenario: driver holds a lock in Create handler and calls app. App
causes page fault that is going to be satisfied in paging I/O. In paging I/O
I’m acquiring same lock as I hold in Create handler. I’m not sure about the
answer. At least, it doesn’t look to me that obvious. Can anyone share some
thoughts on that?

-----Original Message-----
From: Alexey Logachyov [mailto:xxxxx@vba.com.by]
Sent: Friday, January 11, 2002 4:55 AM
To: File Systems Developers
Subject: [ntfsd] lockups again

I’m still struggling with a FSFD. My FSFD intercepts IRP_MJ_CREATE requests
and notifies user mode application and waits for its reply. The problem is
that sometimes when some application opens a file the whole user mode seems
to be stuck. So my UM client cannot continue until the file is opened and
the file cannot be opened until UM client replied. Target OS is NT4 SP6.

Is there any issues known or I should go for some bugs in my driver?

Alexey Logachyov
xxxxx@vba.com.by
VirusBlokAda ltd.
http://www.vba.com.by


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


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

RE: [ntfsd] lockups againPlease explain about DeviceIoControl.

My UM app is very simple. It is actually done just for testing. Here how it works:
0. Creates five threads which implement the same loop.

  1. Calls DeviceIoControl with IOCTL_VBA_GET_INFORMATION_BLOCK giving a valid event object.
  2. Calls GetOverlappedResult.
  3. Calls DeviceIoControl with IOCTL_VBA_SEND_INFORMATION_BLOCK with another event object. I don’t call GetOverlappedResult I far as I do not need the result of operation.
  4. goto 1

So, nothing special. I actually do not understand why DeviceIoControl is gonna block.

I did not think about paging I/O. Gotta investigate. What about IRP_PAGING_IO flag? Does it help?

Alexey Logachyov
xxxxx@vba.com.by
VirusBlokAda Ltd.
http://www.vba.com.by

----- Original Message -----
From: Chtchetkine, Vladimir
To: File Systems Developers
Sent: Friday, January 11, 2002 7:55 PM
Subject: [ntfsd] RE: lockups again

Couple of things:

  1. Check your own locking mechanizm that you use in your driver. Make sure there are no dead-locks or race conditions considering that app may call FS

to satisfy your request.
2. When you communicate with app, you use DevIoControl. And (as far as I remember) it’s sequential routine. Which means that within your process all calls to DevIoCtl (for same handle) will be satisfied in the sequence they were received. So, if there is a call that has not been yet completed all subsequent calls will not go through while the first one is pending.

Regards,

Vladimir

BTW: What would happened if I “accidentaly” block paging I/O on a shared lock. Scenario: driver holds a lock in Create handler and calls app. App causes page fault that is going to be satisfied in paging I/O. In paging I/O I’m acquiring same lock as I hold in Create handler. I’m not sure about the answer. At least, it doesn’t look to me that obvious. Can anyone share some thoughts on that?

-----Original Message-----
From: Alexey Logachyov [mailto:xxxxx@vba.com.by]
Sent: Friday, January 11, 2002 4:55 AM
To: File Systems Developers
Subject: [ntfsd] lockups again

I’m still struggling with a FSFD. My FSFD intercepts IRP_MJ_CREATE requests
and notifies user mode application and waits for its reply. The problem is
that sometimes when some application opens a file the whole user mode seems
to be stuck. So my UM client cannot continue until the file is opened and
the file cannot be opened until UM client replied. Target OS is NT4 SP6.

Is there any issues known or I should go for some bugs in my driver?

Alexey Logachyov
xxxxx@vba.com.by
VirusBlokAda ltd.
http://www.vba.com.by


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


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


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

And not only pIrp->Tail.Overlay.Thread but also
pIrp->Tail.Overlay.Thread->ThreadsProcess. I’m pretty sure that this is not
the case. I’ve just installed Win2k checked build. Did not have time to make
any tests though. Only notice that before wait timeouts it sends several
messages like ‘deadlock detected, creating worker thread’ up to like 10
times or so. Going to investigate on Monday.

Alexey Logachyov
xxxxx@vba.com.by
VirusBlokAda Ltd.
http://www.vba.com.by

Checked build is so much slower. It removed dllcache directory for 26
minutes on P133.

----- Original Message -----
From: “Nicholas Ryan”
To: “File Systems Developers”
Sent: Friday, January 11, 2002 7:31 PM
Subject: [ntfsd] RE: lockups again

> Well, for one you shouldn’t block any IRP_MJ_CREATE requests generated
> by the thread or threads in your application process that are handling
> your filter driver requests, for obvious reasons (you can probably do
> this by comparing pIrp->Tail.Overlay.Thread against a list of
> application thread objects maintained by you). If you are careful not to
> do this, then the remaining possibility is that your application is
> blocked waiting on a different process that is waiting on a create. This
> depends on what APIs your application is calling, and I’m not sure it is
> possible to guarantee this won’t be the case for many APIs (some which
> are implemented as calls to the csrss.exe process).
>
> - Nicholas Ryan
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Alexey Logachyov
> Sent: Friday, January 11, 2002 4:55 AM
> To: File Systems Developers
> Subject: [ntfsd] lockups again
>
> I’m still struggling with a FSFD. My FSFD intercepts IRP_MJ_CREATE
> requests
> and notifies user mode application and waits for its reply. The problem
> is
> that sometimes when some application opens a file the whole user mode
> seems
> to be stuck. So my UM client cannot continue until the file is opened
> and
> the file cannot be opened until UM client replied. Target OS is NT4 SP6.
>
> Is there any issues known or I should go for some bugs in my driver?
>
> Alexey Logachyov
> xxxxx@vba.com.by
> VirusBlokAda ltd.
> http://www.vba.com.by
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@secretseal.com
> To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@vba.com.by
> To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


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

What in the world does it do?:slight_smile:
This takes 26 milliseconds on Free build on 2xP3-866

Checked build is so much slower. It removed dllcache directory for 26
minutes on P133.


Kind regards, Dejan M. www.alfasp.com
E-mail: xxxxx@alfasp.com ICQ#: 56570367
Alfa File Monitor - File monitoring library for Win32 developers.
Alfa File Protector - File protection and hiding library for Win32 developers.
Alfa Registry Monitor - Registry monitoring library for Win32 developers.
Alfa Registry Protector - Registry protection library for Win32 developers.


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

> And not only pIrp->Tail.Overlay.Thread but also

pIrp->Tail.Overlay.Thread->ThreadsProcess.

Is it not what IoGetRequestorProcess does?

Max


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

Probaly. Don’t have IFSKit documentation.

Alexey Logachyov
xxxxx@vba.com.by
VirusBlokAda Ltd.
http://www.vba.com.by

----- Original Message -----
From: “Maxim S. Shatskih”
To: “File Systems Developers”
Sent: Friday, January 11, 2002 11:10 PM
Subject: [ntfsd] RE: lockups again

> > And not only pIrp->Tail.Overlay.Thread but also
> > pIrp->Tail.Overlay.Thread->ThreadsProcess.
>
> Is it not what IoGetRequestorProcess does?
>
> Max
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@vba.com.by
> To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


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

Seem like slow is Windows Explorer. Navigating through file system with Far
Manager is fine.

Alexey Logachyov
xxxxx@vba.com.by
VirusBlokAda Ltd.
http://www.vba.com.by

----- Original Message -----
From: “Dejan Maksimovic”
To: “File Systems Developers”
Sent: Friday, January 11, 2002 11:10 PM
Subject: [ntfsd] RE: lockups again

>
> What in the world does it do?:slight_smile:
> This takes 26 milliseconds on Free build on 2xP3-866
>
> > Checked build is so much slower. It removed dllcache directory for 26
> > minutes on P133.
>
> –
> Kind regards, Dejan M. www.alfasp.com
> E-mail: xxxxx@alfasp.com ICQ#: 56570367
> Alfa File Monitor - File monitoring library for Win32 developers.
> Alfa File Protector - File protection and hiding library for Win32
developers.
> Alfa Registry Monitor - Registry monitoring library for Win32 developers.
> Alfa Registry Protector - Registry protection library for Win32
developers.
>
>
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@vba.com.by
> To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


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