deadlock/hang on vista??

Hi all,

Does anybody have any idea what Ntfs!NtfsWaitForCreateEvent does? We are
having an issue on Vista where a thread decides to wait indefinitely in this
routine for something, but we haven’t quite figured out what is going on
here.

Here’s the stack:

THREAD 898ac740 Cid 17a4.0b7c Teb: 7ffdf000 Win32Thread: fe88c668 WAIT:
(Executive) UserMode Non-Alertable
b13c73b8 NotificationEvent
IRP List:
edb3e980: (0006,028c) Flags: 00000884 Mdl: 00000000
Not impersonating
DeviceMap b4e39510
Owning Process d38e5420 Image: WINWORD.EXE
Wait Start TickCount 11419078 Ticks: 15106 (0:00:03:55.655)
Context Switch Count 1991548 NoStackSwap
UserTime 00:43:48.710
KernelTime 00:02:15.596
Win32 Start Address 0x2ff010cc
Stack Init b13c8000 Current b13c7290 Base b13c8000 Limit b13c5000 Call 0
Priority 14 BasePriority 8 PriorityDecrement 6 IoPriority 2 PagePriority 5
*** ERROR: Module load completed but symbols could not be loaded for
impwinlh.sys
ChildEBP RetAddr Args to Child
b13c72a8 820acacf 898ac7c8 898ac740 898ac7f8 nt!KiSwapContext+0x26 (FPO:
[Uses EBP] [0,0,4])
b13c72e4 8202939e 898ac740 b13c73b8 82028f86 nt!KiSwapThread+0x389
b13c7344 8a776af6 b13c73b8 00000000 00000001 nt!KeWaitForSingleObject+0x414
b13c7374 8a79e770 edb3e980 b13c73b4 b1b60782
Ntfs!NtfsWaitForCreateEvent+0x5e (FPO: [Non-Fpo])
b13c746c 82027f65 86998490 edb3e980 edb3e980 Ntfs!NtfsFsdCreate+0x235 (FPO:
[Non-Fpo])
b13c7484 80665a5c edb3e980 00000000 edb3eb7c nt!IofCallDriver+0x63
b13c74a8 80677a91 b13c74c8 8698c7a8 00000000
fltmgr!FltpLegacyProcessingAfterPreCallbacksCompleted+0x22a (FPO: [Non-Fpo])
b13c74f4 82027f65 8698c7a8 86998008 edb3ebbc fltmgr!FltpCreate+0x2a1 (FPO:
[Non-Fpo])
b13c750c 8a581e20 00000000 8698c8f0 00000009 nt!IofCallDriver+0x63
WARNING: Stack unwind information not available. Following frames may be
wrong.
b13c754c 8a560cfe 8698c8f0 edb3e980 d469bb2c impwinlh+0x30e20
b13c7620 8a554dad 8ddec000 8698c8f0 edb3e980 impwinlh+0xfcfe
b13c7928 8a552e56 c4cfae20 edb3e980 b1b625e2 impwinlh+0x3dad
b13c7980 82027f65 8698c8f0 edb3e980 edb3e980 impwinlh+0x1e56
b13c7998 80665a5c edb3e980 00000000 edb3ebc4 nt!IofCallDriver+0x63
b13c79bc 80677a91 b13c79dc 884a16a8 00000000
fltmgr!FltpLegacyProcessingAfterPreCallbacksCompleted+0x22a (FPO: [Non-Fpo])
b13c7a08 82027f65 884a16a8 884a3bb0 edb3e980 fltmgr!FltpCreate+0x2a1 (FPO:
[Non-Fpo])
b13c7a20 80665a5c edb3e980 00000000 edb3ebe8 nt!IofCallDriver+0x63
b13c7a44 80677a91 b13c7a64 8871c6a8 00000000
fltmgr!FltpLegacyProcessingAfterPreCallbacksCompleted+0x22a (FPO: [Non-Fpo])
b13c7a90 82027f65 8871c6a8 88719768 bd900dcc fltmgr!FltpCreate+0x2a1 (FPO:
[Non-Fpo])
b13c7aa8 821971f3 b13cc0c0 8505adc4 8532dbc0 nt!IofCallDriver+0x63
b13c7b80 821ef123 8532dbd8 00000000 8505ad20 nt!IopParseDevice+0xf9e
b13c7c10 821ec8d3 00000000 b13c7c68 00000040 nt!ObpLookupObjectName+0x615
b13c7c70 821839de 0018ee04 00000000 00000001 nt!ObOpenObjectByName+0x13c
b13c7ce4 8218ec8a 0018ee68 c0100080 0018ee04 nt!IopCreateFile+0x5ec
b13c7d30 8208caea 0018ee68 c0100080 0018ee04 nt!NtCreateFile+0x34
b13c7d30 77b00f34 0018ee68 c0100080 0018ee04 nt!KiFastCallEntry+0x12a (FPO:
[0,3] TrapFrame @ b13c7d64)
0018ee60 00000000 00000000 00000000 00000000 0x77b00f34

Thanks,
Matt

It’s waiting for an oplock break. Are you performing a re-entrant open
on the file? If so, did you preserve the FILE_COMPLETE_IF_OPLOCKED bit
from the original IRP into your re-entrant create?

Try typing “!apc” in the debugger as well.

Tony
OSR

Tony,

I’ll check that we’re preserving that bit, but we don’t have this problem on
XP for sure. Not sure how interesting the !apc output is, but FWIW here it
is:

1: kd> !apc
*** Enumerating APCs in all processes
Process 8455a940 System
Process 887c2390 smss.exe
Process 86bbfa60 csrss.exe
Process 888b0178 csrss.exe
Process 8852a518 wininit.exe
Process 892cab20 services.exe
Process 86bbe638 winlogon.exe
Process 8930ad90 lsass.exe
Process 88501d90 lsm.exe
Process 89508c70 svchost.exe
Process 88757d90 ibmpmsvc.exe
Process 8878e3a8 svchost.exe
Process 89647d90 svchost.exe
Process 8965bd90 svchost.exe
Process 88989af8 svchost.exe
Process 896d8798 audiodg.exe
Process 896eb568 SLsvc.exe
Process 896bd5d0 svchost.exe
Process 8979c8b0 svchost.exe
Process 89826d90 ccSvcHst.exe
Process 89913c48 spoolsv.exe
Process 89974b20 svchost.exe
Process 89a614a8 IPSSVC.EXE
Process 89b97d90 AcPrfMgrSvc.exe
Process 89b9ab30 AEADISRV.EXE
Process 89bf7360 BcmSqlStartupSv
Process 89bf4020 BA_Service.exe
Process 89c0cad8 svchost.exe
Process 89c1e840 DefWatch.exe
Process 89c3dd90 AgentMon.exe
Process 89d0cad8 svchost.exe
Process 89f6d438 SavRoam.exe
Process 89f7db20 svchost.exe
Process 89fbe020 Rtvscan.exe
Process 89fe7a10 tvt_reg_monitor
Process 89febaf8 TPHDEXLG.exe
Process 8a026d90 tvttcsd.exe
Process 8a1537f8 svchost.exe
Process 8a0e2d90 winvnc4.exe
Process 89f0e640 winvnc4.exe
Process 89ef8860 SearchIndexer.e
Process 8a1df1d0 XAudio.exe
Process 8a2abd10 taskeng.exe
Process 8a36ad90 upeksvr.exe
Process 89c19020 SvcGuiHlpr.exe
Process 84c71aa8 svchost.exe
Process 84c50020 taskeng.exe
Process 84c60310 dwm.exe
Process 865e4d90 explorer.exe
Process 84d68af8 EZEJMNAP.EXE
Process 84d683c8 ccApp.exe
Process 84d0caf8 VPTray.exe
Process 888af540 hkcmd.exe
Process 8966fb70 igfxpers.exe
Process 866cdd90 KaUsrTsk.exe
Process 84d3cd90 vmware-tray.exe
Process 84bcd7e0 smax4pnp.exe
Process 8670a490 BA_ControlAgent
Process 8655cd90 igfxsrvc.exe
Process 885e89d8 OUTLOOK.EXE
Process 8d5bb9d8 mobsync.exe
Process 868fd370 SndVol.exe
Process 885cb6a0 AcroRd32.exe
Process 89df2b98 WerFault.exe
Process 893d4588 ieuser.exe
Process 89dbe990 iexplore.exe
Process 84ee1c78 WerFault.exe
Process b63037b0 firefox.exe
Process b63f79c8 rundll32.exe
Process d38e5420 WINWORD.EXE
Process e71936d0 SearchProtocolH
Process 862ca4f0 SearchFilterHos
Process b23358c8 SearchProtocolH
Process c9145ac0 LogonUI.exe
Thread e7056b78 ApcStateIndex 0 ApcListHead e7056bb0 [KERNEL]
KAPC @ 85d88df0
Type 12
KernelRoutine 8221b7a1 nt!PsExitSpecialApc+0
RundownRoutine 8221b7d5 nt!ExFreeCallBack+0

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-338522-
xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Monday, September 29, 2008 11:59 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] deadlock/hang on vista??

It’s waiting for an oplock break. Are you performing a re-entrant open
on the file? If so, did you preserve the FILE_COMPLETE_IF_OPLOCKED bit
from the original IRP into your re-entrant create?

Try typing “!apc” in the debugger as well.

Tony
OSR


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

We are basically cloning the fileobject and putting our own FO in the irp
before sending down. We certainly do not muck with the
FILE_COMPLETE_IF_OPLOCKED bit in the create options, and this flag does not
appear to be set in this case anyway. Would it be possible that this oplock
break operation would cause a system thread to be doing an
IRP_MJ_FLUSH_BUFFERS irp, and that it’s waiting for that?

Also, how do you know that it’s waiting for the oplock break? Just curious.

Matt

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-338522-
xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Monday, September 29, 2008 11:59 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] deadlock/hang on vista??

It’s waiting for an oplock break. Are you performing a re-entrant open
on the file? If so, did you preserve the FILE_COMPLETE_IF_OPLOCKED bit
from the original IRP into your re-entrant create?

Try typing “!apc” in the debugger as well.

Tony
OSR


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

The oplock break is triggered by an APC. The thread listed that has a
pending APC, what is it doing? It’s very likely your culprit.

As for not seeing this on earlier versions, these issues are
timing/scheduling related typically. Someone rewrites a bit of code and
you see a different code path. But oplock deadlocks have been around
for a very long time, and they tend to pop up periodically.

Tony
OSR

Thanks Tony, we’ll bark up that tree…

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-338537-
xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Monday, September 29, 2008 3:15 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] deadlock/hang on vista??

The oplock break is triggered by an APC. The thread listed that has a
pending APC, what is it doing? It’s very likely your culprit.

As for not seeing this on earlier versions, these issues are
timing/scheduling related typically. Someone rewrites a bit of code
and
you see a different code path. But oplock deadlocks have been around
for a very long time, and they tend to pop up periodically.

Tony
OSR


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

Is there anything else that this could possibly be waiting for besides an
oplock break? I’ve got 4 or 5 dumps of the same problem on the same
machine. The commonality across the various dumps is the stack of the
thread waiting in NtfsWaitForCreateEvent, but the !apc command does not
always give pending APCs (sometimes there just are none), so it seems there
must be something else going on here other than an APC deadlock.

0: kd> !thread 85f7f460
THREAD 85f7f460 Cid 1168.14f8 Teb: 7ffdf000 Win32Thread: ff7e3e98 WAIT:
(Executive) UserMode Non-Alertable
b3baf3d0 NotificationEvent
IRP List:
864e6008: (0006,028c) Flags: 00000884 Mdl: 00000000
Not impersonating
DeviceMap 9aa1c608
Owning Process 84c63668 Image: firefox.exe
Wait Start TickCount 4576224 Ticks: 22628 (0:00:05:52.999)
Context Switch Count 2467672 NoStackSwap
UserTime 00:05:21.486
KernelTime 00:03:31.256
Win32 Start Address 0x000b15a0
Stack Init b3bb0000 Current b3baf2a8 Base b3bb0000 Limit b3bad000 Call 0
Priority 14 BasePriority 8 PriorityDecrement 2 IoPriority 2 PagePriority 5
ChildEBP RetAddr Args to Child
b3baf2c0 820acacf 85f7f4e8 85f7f460 85f7f518 nt!KiSwapContext+0x26 (FPO:
[Uses EBP] [0,0,4])
b3baf2fc 8202939e 85f7f460 b3baf3d0 82028f86 nt!KiSwapThread+0x389
b3baf35c 8a776af6 b3baf3d0 00000000 00000001 nt!KeWaitForSingleObject+0x414
b3baf38c 8a79e770 864e6008 b3baf3cc b330876a
Ntfs!NtfsWaitForCreateEvent+0x5e (FPO: [Non-Fpo])
b3baf484 82027f65 86be4020 864e6008 864e6008 Ntfs!NtfsFsdCreate+0x235 (FPO:
[Non-Fpo])
b3baf49c 80665a5c 864e6008 00000000 864e6204 nt!IofCallDriver+0x63
b3baf4c0 80677a91 b3baf4e0 8698f7d8 00000000
fltmgr!FltpLegacyProcessingAfterPreCallbacksCompleted+0x22a (FPO: [Non-Fpo])
b3baf50c 82027f65 8698f7d8 86997408 864e6244 fltmgr!FltpCreate+0x2a1 (FPO:
[Non-Fpo])
b3baf524 8a581e20 00000000 8698fca8 00000009 nt!IofCallDriver+0x63
b3baf564 8a560cfe 8698fca8 864e6008 e3489474
impwinlh!ImpVfsForwardIrpSynchronously+0xf0 (FPO: [Non-Fpo]) (CONV: stdcall)
[c:.…\irproll.c @ 1179]
b3baf638 8a554dad 895e3000 8698fca8 864e6008
impwinlh!ImpVfsCloneAndQuery+0x11fe (FPO: [Non-Fpo]) (CONV: stdcall)
[c:.…\create.c @ 6066]
b3baf940 8a552e56 84cc6960 864e6008 b330a5fa
impwinlh!ImpVfsCommonCreate+0x179d (FPO: [Non-Fpo]) (CONV: stdcall)
[c:.…\create.c @ 1133]
b3baf998 82027f65 8698fca8 864e6008 864e6008 impwinlh!ImpVfsCreate+0x1c6
(FPO: [Non-Fpo]) (CONV: stdcall) [c:.…\create.c @ 183]
b3baf9b0 80665a5c 864e6008 00000000 864e624c nt!IofCallDriver+0x63
b3baf9d4 80677a91 b3baf9f4 8852d658 00000000
fltmgr!FltpLegacyProcessingAfterPreCallbacksCompleted+0x22a (FPO: [Non-Fpo])
b3bafa20 82027f65 8852d658 88538008 864e6008 fltmgr!FltpCreate+0x2a1 (FPO:
[Non-Fpo])
b3bafa38 80665a5c 864e6008 00000000 864e6270 nt!IofCallDriver+0x63
b3bafa5c 80677a91 b3bafa7c 887346a8 00000000
fltmgr!FltpLegacyProcessingAfterPreCallbacksCompleted+0x22a (FPO: [Non-Fpo])
b3bafaa8 82027f65 887346a8 88735768 afc74854 fltmgr!FltpCreate+0x2a1 (FPO:
[Non-Fpo])
b3bafac0 821971f3 b3ba40d8 c4d08c94 867d9e08 nt!IofCallDriver+0x63
b3bafb98 821ef123 867d9e20 00000000 c4d08bf0 nt!IopParseDevice+0xf9e
b3bafc28 821ec8d3 00000000 b3bafc80 00000040 nt!ObpLookupObjectName+0x615
b3bafc88 821839de 0023e67c 00000000 00000001 nt!ObOpenObjectByName+0x13c
b3bafcfc 821900ed 0023e6c4 00010080 0023e67c nt!IopCreateFile+0x5ec
b3bafd44 8208caea 0023e6c4 00010080 0023e67c nt!NtOpenFile+0x2a
b3bafd44 771c0f34 0023e6c4 00010080 0023e67c nt!KiFastCallEntry+0x12a (FPO:
[0,3] TrapFrame @ b3bafd64)
WARNING: Frame IP not in any known module. Following frames may be wrong.
0023e6cc 00000000 00000000 00000000 00000000 0x771c0f34

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-338537-
xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Monday, September 29, 2008 3:15 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] deadlock/hang on vista??

The oplock break is triggered by an APC. The thread listed that has a
pending APC, what is it doing? It’s very likely your culprit.

As for not seeing this on earlier versions, these issues are
timing/scheduling related typically. Someone rewrites a bit of code
and
you see a different code path. But oplock deadlocks have been around
for a very long time, and they tend to pop up periodically.

Tony
OSR


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

Nope. That function is only used in a single place, and it’s used to
wait for an oplock to be completed. I can think of some potential
complicated scenarios in which you wouldn’t see the APC, but they all
revolve around oplocks.

Are you doing a re-entrant create? Have you tried setting the
FILE_COMPLETE_IF_OPLOCKED flag? I’d expect that if you did, you won’t
see it block in this particular case (although you still have to decide
what you want to do when that condition arises - you can’t use the file
object yet.) At least if you see it, you’ll know that this really is
the situation.

As a quick “down and dirty” on this, you might want to try disabling
oplocks and see if that makes the problem go away (there’s a registry
hack that does it, or you can change your driver to take out a byte
range lock. You don’t need to HOLD the byte range lock, you just need to
acquire it.)

Tony
OSR

Thanks for the help Tony. We’re not *technically* doing an re-entrant
create (if what you mean is calling ZwCreateFile while processing a CREATE
IRP), what we’re doing is replacing the fileobject in the create IRP with
our own, and then allowing the create to proceed (that’s what’s going on in
that thread’s stack). We’ll give your suggestions a try.

Does anybody know how to disable oplocks on vista? Disabling oplocks is
mentioned here:

http://support.microsoft.com/kb/296264

With this wonderfully self-contracting text:

************************************
Notes for Windows Vista

The opportunistic locking registry keys are valid only for traditional SMB
(SMB1). You cannot turn off opportunistic locking for SMB2. SMB2 was
introduced in Windows Vista to enable faster communication between computer
that are running Windows Vista and Windows Server 2008.

If you disable opportunistic locking, the offline files feature in Windows
Vista fails.
***************************************

So, you cannot turn off oplocks in Vista (SMB2). But if you do manage to
get it turned off (they just said you can’t turn it off), offline files
fails!!! Uh, ok.

Matt

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-338673-
xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Tuesday, September 30, 2008 12:55 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] deadlock/hang on vista??

Nope. That function is only used in a single place, and it’s used to
wait for an oplock to be completed. I can think of some potential
complicated scenarios in which you wouldn’t see the APC, but they all
revolve around oplocks.

Are you doing a re-entrant create? Have you tried setting the
FILE_COMPLETE_IF_OPLOCKED flag? I’d expect that if you did, you won’t
see it block in this particular case (although you still have to decide
what you want to do when that condition arises - you can’t use the file
object yet.) At least if you see it, you’ll know that this really is
the situation.

As a quick “down and dirty” on this, you might want to try disabling
oplocks and see if that makes the problem go away (there’s a registry
hack that does it, or you can change your driver to take out a byte
range lock. You don’t need to HOLD the byte range lock, you just need
to
acquire it.)

Tony
OSR


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

You can turn off oplocks for SMB1. (You could disable SMB2, then.)

Of course, this would be for testing purposes - you wouldn’t want to ship code that relies on oplocks being disabled.

  • S

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Matthew N. White
Sent: Tuesday, September 30, 2008 3:33 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] deadlock/hang on vista??

Thanks for the help Tony. We’re not *technically* doing an re-entrant
create (if what you mean is calling ZwCreateFile while processing a CREATE
IRP), what we’re doing is replacing the fileobject in the create IRP with
our own, and then allowing the create to proceed (that’s what’s going on in
that thread’s stack). We’ll give your suggestions a try.

Does anybody know how to disable oplocks on vista? Disabling oplocks is
mentioned here:

http://support.microsoft.com/kb/296264

With this wonderfully self-contracting text:

************************************
Notes for Windows Vista

The opportunistic locking registry keys are valid only for traditional SMB
(SMB1). You cannot turn off opportunistic locking for SMB2. SMB2 was
introduced in Windows Vista to enable faster communication between computer
that are running Windows Vista and Windows Server 2008.

If you disable opportunistic locking, the offline files feature in Windows
Vista fails.
***************************************

So, you cannot turn off oplocks in Vista (SMB2). But if you do manage to
get it turned off (they just said you can’t turn it off), offline files
fails!!! Uh, ok.

Matt

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-338673-
xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Tuesday, September 30, 2008 12:55 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] deadlock/hang on vista??

Nope. That function is only used in a single place, and it’s used to
wait for an oplock to be completed. I can think of some potential
complicated scenarios in which you wouldn’t see the APC, but they all
revolve around oplocks.

Are you doing a re-entrant create? Have you tried setting the
FILE_COMPLETE_IF_OPLOCKED flag? I’d expect that if you did, you won’t
see it block in this particular case (although you still have to decide
what you want to do when that condition arises - you can’t use the file
object yet.) At least if you see it, you’ll know that this really is
the situation.

As a quick “down and dirty” on this, you might want to try disabling
oplocks and see if that makes the problem go away (there’s a registry
hack that does it, or you can change your driver to take out a byte
range lock. You don’t need to HOLD the byte range lock, you just need
to
acquire it.)

Tony
OSR


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: xxxxx@valhallalegends.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Right. But my problem is happening with SMB2 (if that’s Vista’s default).
I won’t know if my problem is with oplocks or with SMB2 generally…

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-338708-
xxxxx@lists.osr.com] On Behalf Of Skywing
Sent: Tuesday, September 30, 2008 3:36 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] deadlock/hang on vista??

You can turn off oplocks for SMB1. (You could disable SMB2, then.)

Of course, this would be for testing purposes - you wouldn’t want to
ship code that relies on oplocks being disabled.

  • S

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-338706-
xxxxx@lists.osr.com] On Behalf Of Matthew N. White
Sent: Tuesday, September 30, 2008 3:33 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] deadlock/hang on vista??

Thanks for the help Tony. We’re not *technically* doing an re-entrant
create (if what you mean is calling ZwCreateFile while processing a
CREATE
IRP), what we’re doing is replacing the fileobject in the create IRP
with
our own, and then allowing the create to proceed (that’s what’s going
on in
that thread’s stack). We’ll give your suggestions a try.

Does anybody know how to disable oplocks on vista? Disabling oplocks
is
mentioned here:

http://support.microsoft.com/kb/296264

With this wonderfully self-contracting text:

************************************
Notes for Windows Vista

The opportunistic locking registry keys are valid only for traditional
SMB
(SMB1). You cannot turn off opportunistic locking for SMB2. SMB2 was
introduced in Windows Vista to enable faster communication between
computer
that are running Windows Vista and Windows Server 2008.

If you disable opportunistic locking, the offline files feature in
Windows
Vista fails.
***************************************

So, you cannot turn off oplocks in Vista (SMB2). But if you do manage
to
get it turned off (they just said you can’t turn it off), offline files
fails!!! Uh, ok.

Matt

> -----Original Message-----
> From: xxxxx@lists.osr.com [mailto:bounce-338673-
> xxxxx@lists.osr.com] On Behalf Of Tony Mason
> Sent: Tuesday, September 30, 2008 12:55 PM
> To: Windows File Systems Devs Interest List
> Subject: RE: [ntfsd] deadlock/hang on vista??
>
> Nope. That function is only used in a single place, and it’s used to
> wait for an oplock to be completed. I can think of some potential
> complicated scenarios in which you wouldn’t see the APC, but they all
> revolve around oplocks.
>
> Are you doing a re-entrant create? Have you tried setting the
> FILE_COMPLETE_IF_OPLOCKED flag? I’d expect that if you did, you
won’t
> see it block in this particular case (although you still have to
decide
> what you want to do when that condition arises - you can’t use the
file
> object yet.) At least if you see it, you’ll know that this really is
> the situation.
>
> As a quick “down and dirty” on this, you might want to try disabling
> oplocks and see if that makes the problem go away (there’s a registry
> hack that does it, or you can change your driver to take out a byte
> range lock. You don’t need to HOLD the byte range lock, you just need
> to
> acquire it.)
>
> Tony
> OSR
>
>
> —
> 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 leave-338673-
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: xxxxx@valhallalegends.com
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

Sadly, SMB isn’t the only consumer of oplocks.

There is a meme in MS authored code of about Vista vintage which uses
oplocks to sense other activity and then “get out of the way”.

Are you blocking any other filesystem operations (particularly create)
while this create proceeds? The indexer uses oplocks and will often fire
off several Creates in response to oplock break request - and does not
release the oplock until those creates are done.

offline files fail

In my experience a shake of a butterfly’s wings will break CSC - especially
if you have the temrity to want to change the data.

Have fun.

“Skywing” wrote in message news:xxxxx@ntfsd…
You can turn off oplocks for SMB1. (You could disable SMB2, then.)

Of course, this would be for testing purposes - you wouldn’t want to ship
code that relies on oplocks being disabled.

- S

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Matthew N. White
Sent: Tuesday, September 30, 2008 3:33 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] deadlock/hang on vista??

Thanks for the help Tony. We’re not technically doing an re-entrant
create (if what you mean is calling ZwCreateFile while processing a CREATE
IRP), what we’re doing is replacing the fileobject in the create IRP with
our own, and then allowing the create to proceed (that’s what’s going on in
that thread’s stack). We’ll give your suggestions a try.

Does anybody know how to disable oplocks on vista? Disabling oplocks is
mentioned here:

http://support.microsoft.com/kb/296264

With this wonderfully self-contracting text:


Notes for Windows Vista

The opportunistic locking registry keys are valid only for traditional SMB
(SMB1). You cannot turn off opportunistic locking for SMB2. SMB2 was
introduced in Windows Vista to enable faster communication between computer
that are running Windows Vista and Windows Server 2008.

If you disable opportunistic locking, the offline files feature in Windows
Vista fails.
***

So, you cannot turn off oplocks in Vista (SMB2). But if you do manage to
get it turned off (they just said you can’t turn it off), offline files
fails!!! Uh, ok.

Matt

> -----Original Message-----
> From: xxxxx@lists.osr.com [mailto:bounce-338673-
> xxxxx@lists.osr.com] On Behalf Of Tony Mason
> Sent: Tuesday, September 30, 2008 12:55 PM
> To: Windows File Systems Devs Interest List
> Subject: RE: [ntfsd] deadlock/hang on vista??
>
> Nope. That function is only used in a single place, and it’s used to
> wait for an oplock to be completed. I can think of some potential
> complicated scenarios in which you wouldn’t see the APC, but they all
> revolve around oplocks.
>
> Are you doing a re-entrant create? Have you tried setting the
> FILE_COMPLETE_IF_OPLOCKED flag? I’d expect that if you did, you won’t
> see it block in this particular case (although you still have to decide
> what you want to do when that condition arises - you can’t use the file
> object yet.) At least if you see it, you’ll know that this really is
> the situation.
>
> As a quick “down and dirty” on this, you might want to try disabling
> oplocks and see if that makes the problem go away (there’s a registry
> hack that does it, or you can change your driver to take out a byte
> range lock. You don’t need to HOLD the byte range lock, you just need
> to
> acquire it.)
>
> Tony
> OSR
>
>
> —
> 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: xxxxx@valhallalegends.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

What process is the “indexer”?

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-339025-
xxxxx@lists.osr.com] On Behalf Of Rod Widdowson
Sent: Friday, October 03, 2008 4:54 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] deadlock/hang on vista??

Sadly, SMB isn’t the only consumer of oplocks.

There is a meme in MS authored code of about Vista vintage which uses
oplocks to sense other activity and then “get out of the way”.

Are you blocking any other filesystem operations (particularly create)
while this create proceeds? The indexer uses oplocks and will often
fire
off several Creates in response to oplock break request - and does not
release the oplock until those creates are done.

> offline files fail

In my experience a shake of a butterfly’s wings will break CSC -
especially
if you have the temrity to want to change the data.

Have fun.

“Skywing” wrote in message
> news:xxxxx@ntfsd…
> You can turn off oplocks for SMB1. (You could disable SMB2, then.)
>
> Of course, this would be for testing purposes - you wouldn’t want to
> ship
> code that relies on oplocks being disabled.
>
> - S
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Matthew N.
> White
> Sent: Tuesday, September 30, 2008 3:33 PM
> To: Windows File Systems Devs Interest List
> Subject: RE: [ntfsd] deadlock/hang on vista??
>
> Thanks for the help Tony. We’re not technically doing an re-entrant
> create (if what you mean is calling ZwCreateFile while processing a
> CREATE
> IRP), what we’re doing is replacing the fileobject in the create IRP
> with
> our own, and then allowing the create to proceed (that’s what’s going
> on in
> that thread’s stack). We’ll give your suggestions a try.
>
> Does anybody know how to disable oplocks on vista? Disabling oplocks
> is
> mentioned here:
>
> http://support.microsoft.com/kb/296264
>
> With this wonderfully self-contracting text:
>
>
> Notes for Windows Vista
>
> The opportunistic locking registry keys are valid only for traditional
> SMB
> (SMB1). You cannot turn off opportunistic locking for SMB2. SMB2 was
> introduced in Windows Vista to enable faster communication between
> computer
> that are running Windows Vista and Windows Server 2008.
>
> If you disable opportunistic locking, the offline files feature in
> Windows
> Vista fails.
>
***
>
> So, you cannot turn off oplocks in Vista (SMB2). But if you do manage
> to
> get it turned off (they just said you can’t turn it off), offline files
> fails!!! Uh, ok.
>
> Matt
>
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com [mailto:bounce-338673-
> > xxxxx@lists.osr.com] On Behalf Of Tony Mason
> > Sent: Tuesday, September 30, 2008 12:55 PM
> > To: Windows File Systems Devs Interest List
> > Subject: RE: [ntfsd] deadlock/hang on vista??
> >
> > Nope. That function is only used in a single place, and it’s used to
> > wait for an oplock to be completed. I can think of some potential
> > complicated scenarios in which you wouldn’t see the APC, but they all
> > revolve around oplocks.
> >
> > Are you doing a re-entrant create? Have you tried setting the
> > FILE_COMPLETE_IF_OPLOCKED flag? I’d expect that if you did, you
> won’t
> > see it block in this particular case (although you still have to
> decide
> > what you want to do when that condition arises - you can’t use the
> file
> > object yet.) At least if you see it, you’ll know that this really is
> > the situation.
> >
> > As a quick “down and dirty” on this, you might want to try disabling
> > oplocks and see if that makes the problem go away (there’s a registry
> > hack that does it, or you can change your driver to take out a byte
> > range lock. You don’t need to HOLD the byte range lock, you just need
> > to
> > acquire it.)
> >
> > Tony
> > OSR
> >
> >
> > —
> > 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 leave-338673-
> 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: xxxxx@valhallalegends.com
> 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: xxxxx@bitarmor.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Rod,

It appears SearchIndexer.exe is running. You are the man. Er- could be the
man…

Matt

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-339025-
xxxxx@lists.osr.com] On Behalf Of Rod Widdowson
Sent: Friday, October 03, 2008 4:54 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] deadlock/hang on vista??

Sadly, SMB isn’t the only consumer of oplocks.

There is a meme in MS authored code of about Vista vintage which uses
oplocks to sense other activity and then “get out of the way”.

Are you blocking any other filesystem operations (particularly create)
while this create proceeds? The indexer uses oplocks and will often
fire
off several Creates in response to oplock break request - and does not
release the oplock until those creates are done.

> offline files fail

In my experience a shake of a butterfly’s wings will break CSC -
especially
if you have the temrity to want to change the data.

Have fun.

“Skywing” wrote in message
> news:xxxxx@ntfsd…
> You can turn off oplocks for SMB1. (You could disable SMB2, then.)
>
> Of course, this would be for testing purposes - you wouldn’t want to
> ship
> code that relies on oplocks being disabled.
>
> - S
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Matthew N.
> White
> Sent: Tuesday, September 30, 2008 3:33 PM
> To: Windows File Systems Devs Interest List
> Subject: RE: [ntfsd] deadlock/hang on vista??
>
> Thanks for the help Tony. We’re not technically doing an re-entrant
> create (if what you mean is calling ZwCreateFile while processing a
> CREATE
> IRP), what we’re doing is replacing the fileobject in the create IRP
> with
> our own, and then allowing the create to proceed (that’s what’s going
> on in
> that thread’s stack). We’ll give your suggestions a try.
>
> Does anybody know how to disable oplocks on vista? Disabling oplocks
> is
> mentioned here:
>
> http://support.microsoft.com/kb/296264
>
> With this wonderfully self-contracting text:
>
>
> Notes for Windows Vista
>
> The opportunistic locking registry keys are valid only for traditional
> SMB
> (SMB1). You cannot turn off opportunistic locking for SMB2. SMB2 was
> introduced in Windows Vista to enable faster communication between
> computer
> that are running Windows Vista and Windows Server 2008.
>
> If you disable opportunistic locking, the offline files feature in
> Windows
> Vista fails.
>
***
>
> So, you cannot turn off oplocks in Vista (SMB2). But if you do manage
> to
> get it turned off (they just said you can’t turn it off), offline files
> fails!!! Uh, ok.
>
> Matt
>
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com [mailto:bounce-338673-
> > xxxxx@lists.osr.com] On Behalf Of Tony Mason
> > Sent: Tuesday, September 30, 2008 12:55 PM
> > To: Windows File Systems Devs Interest List
> > Subject: RE: [ntfsd] deadlock/hang on vista??
> >
> > Nope. That function is only used in a single place, and it’s used to
> > wait for an oplock to be completed. I can think of some potential
> > complicated scenarios in which you wouldn’t see the APC, but they all
> > revolve around oplocks.
> >
> > Are you doing a re-entrant create? Have you tried setting the
> > FILE_COMPLETE_IF_OPLOCKED flag? I’d expect that if you did, you
> won’t
> > see it block in this particular case (although you still have to
> decide
> > what you want to do when that condition arises - you can’t use the
> file
> > object yet.) At least if you see it, you’ll know that this really is
> > the situation.
> >
> > As a quick “down and dirty” on this, you might want to try disabling
> > oplocks and see if that makes the problem go away (there’s a registry
> > hack that does it, or you can change your driver to take out a byte
> > range lock. You don’t need to HOLD the byte range lock, you just need
> > to
> > acquire it.)
> >
> > Tony
> > OSR
> >
> >
> > —
> > 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 leave-338673-
> 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: xxxxx@valhallalegends.com
> 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: xxxxx@bitarmor.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com