STATUS_OPLOCK_BREAK_IN_PROGRESS

Hi,

In a filter driver, I want to filter something.
In the IRP_MJ_CREATE handler, I call the lower driver
and then decide what to do.

What should I do, if I receive the
STATUS_OPLOCK_BREAK_IN_PROGRESS ?

If I am correct, this means that the file exists, but has
been recently open by a remote client and the FSD
is waiting until all caches gets flushed
(to avoid stale data problems).

I expect that when I get this error,
I should wait for something and then consider the file open.
Is it correct ?

L.

Well, in the page

http://www.osronline.com/lists_archive/ntfsd/thread1910.html

I found, that the filter driver should
“must delay the post-processing until after the break”

Well, but how do I do the waiting ?

----- Original Message -----
From: “Ladislav Zezula”
To: “Windows File Systems Devs Interest List”
Sent: Tuesday, August 03, 2004 9:56 AM
Subject: [ntfsd] STATUS_OPLOCK_BREAK_IN_PROGRESS

> Hi,
>
> In a filter driver, I want to filter something.
> In the IRP_MJ_CREATE handler, I call the lower driver
> and then decide what to do.
>
> What should I do, if I receive the
> STATUS_OPLOCK_BREAK_IN_PROGRESS ?
>
> If I am correct, this means that the file exists, but has
> been recently open by a remote client and the FSD
> is waiting until all caches gets flushed
> (to avoid stale data problems).
>
> I expect that when I get this error,
> I should wait for something and then consider the file open.
> Is it correct ?
>
> L.
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@volny.cz
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

The problem is that the oplock break must proceed; the caller needs to
make a second call (FSCTL_xxx - I don’t have the IFS Kit with me right
now so I can’t find the exact value, but I know I’ve written about this
before…)

Because the call RETURNS to the caller, it allows the APC to execute
(the one that SRV needs to execute to process the oplock break) and then
the caller must call back down to perform the oplock break processing.
Thus, you can’t do this in a filter driver, since the thread of
execution might be THE thread that must execute the APC - back up in the
SRV context.

So, the real answer is you don’t wait - you perform processing in the
secondary FSCTL call.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources Inc.
http://www.osr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ladislav Zezula
Sent: Tuesday, August 03, 2004 10:53 AM
To: ntfsd redirect
Subject: Re: [ntfsd] STATUS_OPLOCK_BREAK_IN_PROGRESS

Well, in the page

http://www.osronline.com/lists_archive/ntfsd/thread1910.html

I found, that the filter driver should
“must delay the post-processing until after the break”

Well, but how do I do the waiting ?

----- Original Message -----
From: “Ladislav Zezula”
To: “Windows File Systems Devs Interest List”
Sent: Tuesday, August 03, 2004 9:56 AM
Subject: [ntfsd] STATUS_OPLOCK_BREAK_IN_PROGRESS

> Hi,
>
> In a filter driver, I want to filter something.
> In the IRP_MJ_CREATE handler, I call the lower driver
> and then decide what to do.
>
> What should I do, if I receive the
> STATUS_OPLOCK_BREAK_IN_PROGRESS ?
>
> If I am correct, this means that the file exists, but has
> been recently open by a remote client and the FSD
> is waiting until all caches gets flushed
> (to avoid stale data problems).
>
> I expect that when I get this error,
> I should wait for something and then consider the file open.
> Is it correct ?
>
> L.
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@volny.cz
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> now so I can’t find the exact value, but I know I’ve written about this

before…)

Is it FSCTL_OPLOCK_BREAK_ACKNOWLEDGE ?

L.

I believe you want FSCTL_OPLOCK_BREAK_NOTIFY.

Presumably, when the remote client tries to open a file and gets a result of
STATUS_OPLOCK_BREAK_IN_PROGRESS, it would then issue an
FSCTL_OPLOCK_BREAK_NOTIFY request, which the server would pend until the
oplock has really been broken (which may entail communicating with other
remote clients). Then, with the oplock finally broken, the server would
complete the FSCTL_OPLOCK_BREAK_NOTIFY request. On getting a result of
STATUS_SUCCESS the original client would know it was now Ok to use the file
handle opened earlier.

This and other FSCTLs related to oplock processing are described in some
detail in the MSDN Library.

-----Original Message-----
From: Ladislav Zezula [mailto:xxxxx@volny.cz]
Sent: Thursday, August 05, 2004 11:01 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] STATUS_OPLOCK_BREAK_IN_PROGRESS

now so I can’t find the exact value, but I know I’ve written about
this
before…)

Is it FSCTL_OPLOCK_BREAK_ACKNOWLEDGE ?

L.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@veritas.com To
unsubscribe send a blank email to xxxxx@lists.osr.com