Our filter driver seems to have hit a deadlock with contention for
ownership of an ERESOURCE lock. At the time of the hang, we break into the
system and see a particular ERESOURCE lock with 1 shared owner, 1 exclusive
waiter, and 10 shared waiters. The shared waiters are all waiting a few
levels deep in NtfsAcquireSharedVcb(), all waiting to do something on the
same volume. The exclusive waiter is waiting a few levels deep in
NtfsAcquireExclusiveVcb(). So far, not so bad.
But the shared owner of the lock seems to be waiting to acquire the SAME
LOCK again, shared. Here’s the stack of the owner (apologies for
wrapping):
ChildEBP RetAddr Args to Child
b99614b4 8042bd4d 00000000 813fb504 ffa4e350 nt!KiSwapThread+0x1b1
b99614dc 804152f2 813e4328 00000000 00000000
nt!KeWaitForSingleObject+0x1a3
b996151c 80414886 811207f8 b99617e8 00000000 nt!ExpWaitForResource+0x1b4
b9961534 bfe9c674 813fb500 00000001 b99617e8
nt!ExAcquireResourceSharedLite+0xc6
b9961544 bfe9c1aa b99617e8 813fb100 00000001
ntfs!NtfsAcquireSharedVcb+0x1b
b99617a0 bfe9b971 b99617e8 811862c8 813fb030 ntfs!NtfsCommonCleanup+0x134
b9961918 8041d915 813fb030 811862c8 811864a0 ntfs!NtfsFsdCleanup+0x113
b996192c b9c56874 811864a0 811864c4 811862d8 nt!IopfCallDriver+0x35
b9961968 b9c58e1e 811b73e8 811862c8 00000000 rxfsfltr!CallAndRelease+0x176
b99619d8 8041d915 811b7330 811862c8 811207f8 rxfsfltr!FilterDispatch+0x449
b99619ec 804c1e67 80064ffc 820c5b40 00000001 nt!IopfCallDriver+0x35
b9961a20 804d840b 820ad030 811b7330 01020000 nt!IopCloseFile+0x267
b9961a4c 8044f37a 820ad030 811207e4 811207f8
nt!ObpDecrementHandleCount+0x13d
b9961b00 80465679 000002e0 e3155528 00000000 nt!NtClose+0x1f0
b9961b00 8042f917 000002e0 e3155528 00000000 nt!KiSystemService+0xc9
b9961b7c b99a42a1 000002e0 000002e0 00000000 nt!ZwClose+0xb
Anyway, you can see he’s waiting a few levels deep in
NtfsAcquireSharedVcb(), actually waiting for the KEVENT object at 813e4328,
which is the SharedWaiters PKEVENT from the ERESOURCE in question.
But this thread already owns the ERESOURCE shared. According to IFS kit
documentation, a second call to ExAcquireResourceSharedLite() by a thread
that already owns the resource should grant the same type of access
recursively. Why is he waiting for it again? Is it possible that the
Exclusive Waiter blocks ALL subsequent attempts to acquire the resource
shared, even if the current thread already owns the resource shared?
Carl Appellof
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