Do I need to use an IO_REMOVE_LOCK in an fs filter?

Do I need to use an IO_REMOVE_LOCK in an fs filter? I’ve got a file system
filter that a customer is using on a cluster server. When a cluster disk
fails over, I get an IRQL_NOT_LESS_OR_EQUAL in a completion routine for a
close request because I try to acquire a spin lock in my device extension,
but my device object is freed while this IRP is processed. I assume it is
freed because the memory location for the device object is invalid and my
driver object does not list the device object in the call stack as one of
its device objects. Thie request is processed synchronously and the
request was not queued.

Do I need to use an IO_REMOVE_LOCK in my fs filter?

No, you need to stop deleting your device object prematurely. It is not
the I/O subsystem that deletes your device object, it is your driver.
My *guess* is that you delete it in your fast I/O detach device entry
point - but you should not do that if you have outstanding I/O
operations.

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
xxxxx@xmission.com
Sent: Monday, November 29, 2004 4:30 PM
To: ntfsd redirect
Subject: [ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

Do I need to use an IO_REMOVE_LOCK in an fs filter? I’ve got a file
system
filter that a customer is using on a cluster server. When a cluster
disk
fails over, I get an IRQL_NOT_LESS_OR_EQUAL in a completion routine for
a
close request because I try to acquire a spin lock in my device
extension,
but my device object is freed while this IRP is processed. I assume it
is
freed because the memory location for the device object is invalid and
my
driver object does not list the device object in the call stack as one
of
its device objects. Thie request is processed synchronously and the
request was not queued.

Do I need to use an IO_REMOVE_LOCK in my fs filter?


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

What version of the OS and what file system are you seeing this on?

FAT has a bug where it deletes its device object while operations are
still in progress. These bugs in FAT have been fixed in XP and later.

Tony, I have seen you mention this before. Aside from this bug in FAT I
have never seen a FastIo detach called while there are outstanding
operations. Can you please give a scenario where you see this?

I believe it is correct to delete the device object in FastIO detach
since this is what our IFSKit samples do.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Monday, November 29, 2004 5:26 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

No, you need to stop deleting your device object prematurely. It is not
the I/O subsystem that deletes your device object, it is your driver.
My *guess* is that you delete it in your fast I/O detach device entry
point - but you should not do that if you have outstanding I/O
operations.

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
xxxxx@xmission.com
Sent: Monday, November 29, 2004 4:30 PM
To: ntfsd redirect
Subject: [ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

Do I need to use an IO_REMOVE_LOCK in an fs filter? I’ve got a file
system
filter that a customer is using on a cluster server. When a cluster
disk
fails over, I get an IRQL_NOT_LESS_OR_EQUAL in a completion routine for
a
close request because I try to acquire a spin lock in my device
extension,
but my device object is freed while this IRP is processed. I assume it
is
freed because the memory location for the device object is invalid and
my
driver object does not list the device object in the call stack as one
of
its device objects. Thie request is processed synchronously and the
request was not queued.

Do I need to use an IO_REMOVE_LOCK in my fs filter?


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


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

You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

“It is not the I/O subsystem that deletes your device object, it is your
driver.” Sorry, I didn’t mention that I had freed it from the fast IO
detach call. What I’m confused about is getting this call while a request
is outstanding. Do I need to do something to handle this situation or
should this not happen. If I need to do something, what is the convetional
way of doing this? That’s why I suggested an IO_REMOVE_LOCK, because it
does just that: keeps track of outstanding IO.

This is happening on Windows 2000 Server SP4 MP on a cluster server. The
file system I’m attached to is NTFS. Again this is happening on a cluster
when a disk is moved from one node to another. I’m not sure if you would
expect the same behavior as a normal dismount.

Thanks,

Jonathan

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
What version of the OS and what file system are you seeing this on?

FAT has a bug where it deletes its device object while operations are
still in progress. These bugs in FAT have been fixed in XP and later.

Tony, I have seen you mention this before. Aside from this bug in FAT I
have never seen a FastIo detach called while there are outstanding
operations. Can you please give a scenario where you see this?

I believe it is correct to delete the device object in FastIO detach
since this is what our IFSKit samples do.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Monday, November 29, 2004 5:26 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

No, you need to stop deleting your device object prematurely. It is not
the I/O subsystem that deletes your device object, it is your driver.
My guess is that you delete it in your fast I/O detach device entry
point - but you should not do that if you have outstanding I/O
operations.

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
xxxxx@xmission.com
Sent: Monday, November 29, 2004 4:30 PM
To: ntfsd redirect
Subject: [ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

Do I need to use an IO_REMOVE_LOCK in an fs filter? I’ve got a file
system
filter that a customer is using on a cluster server. When a cluster
disk
fails over, I get an IRQL_NOT_LESS_OR_EQUAL in a completion routine for
a
close request because I try to acquire a spin lock in my device
extension,
but my device object is freed while this IRP is processed. I assume it
is
freed because the memory location for the device object is invalid and
my
driver object does not list the device object in the call stack as one
of
its device objects. Thie request is processed synchronously and the
request was not queued.

Do I need to use an IO_REMOVE_LOCK in my fs filter?


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


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

You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Jonathan,

You should not have to do anything to handle this situation. You should
not be receiving IO requests after FastIoDetach has been called. If you
do this is a bug in the system. You should talk with your Microsoft
support person and work with them to get a fix. It is possible a fix is
already available. Can you tell me what IRP you are seeing?

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jonathan Ludwig
Sent: Wednesday, December 01, 2004 8:42 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

"It is not the I/O subsystem that deletes your device object, it is your

driver." Sorry, I didn’t mention that I had freed it from the fast IO
detach call. What I’m confused about is getting this call while a
request
is outstanding. Do I need to do something to handle this situation or
should this not happen. If I need to do something, what is the
convetional
way of doing this? That’s why I suggested an IO_REMOVE_LOCK, because it

does just that: keeps track of outstanding IO.

This is happening on Windows 2000 Server SP4 MP on a cluster server.
The
file system I’m attached to is NTFS. Again this is happening on a
cluster
when a disk is moved from one node to another. I’m not sure if you
would
expect the same behavior as a normal dismount.

Thanks,

Jonathan

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
What version of the OS and what file system are you seeing this on?

FAT has a bug where it deletes its device object while operations are
still in progress. These bugs in FAT have been fixed in XP and later.

Tony, I have seen you mention this before. Aside from this bug in FAT I
have never seen a FastIo detach called while there are outstanding
operations. Can you please give a scenario where you see this?

I believe it is correct to delete the device object in FastIO detach
since this is what our IFSKit samples do.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Monday, November 29, 2004 5:26 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

No, you need to stop deleting your device object prematurely. It is not
the I/O subsystem that deletes your device object, it is your driver.
My guess is that you delete it in your fast I/O detach device entry
point - but you should not do that if you have outstanding I/O
operations.

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
xxxxx@xmission.com
Sent: Monday, November 29, 2004 4:30 PM
To: ntfsd redirect
Subject: [ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

Do I need to use an IO_REMOVE_LOCK in an fs filter? I’ve got a file
system
filter that a customer is using on a cluster server. When a cluster
disk
fails over, I get an IRQL_NOT_LESS_OR_EQUAL in a completion routine for
a
close request because I try to acquire a spin lock in my device
extension,
but my device object is freed while this IRP is processed. I assume it
is
freed because the memory location for the device object is invalid and
my
driver object does not list the device object in the call stack as one
of
its device objects. Thie request is processed synchronously and the
request was not queued.

Do I need to use an IO_REMOVE_LOCK in my fs filter?


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


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

You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
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@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Our work-around for this class of problems (which we’ve seen with both
FAT and NTFS, although I know Neal, et. al. have changed FAT at least to
try and eliminate these) is to reference count our device object.

We actually discussed this situation on OSR Online
(http://www.osronline.com/article.cfm?id=34) and described the basic
technique we have seen.

We have see the “device object goes away before the IRP is completed”
issue with respect to removable media, autochk, and in cluster
configurations like you describe, with both FAT and NTFS. While I
appreciate that Microsoft will fix such problems, as found and reported,
our approach at OSR has always been to make it work for all versions of
the OS. There are always customers that cannot (or will not) upgrade to
the latest versions of the OS, service pack, etc. Many of you still
have NT 4.0 customers (why move off a stable “reliable” base?)

I hope this helps.

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 Jonathan Ludwig
Sent: Wednesday, December 01, 2004 11:42 AM
To: ntfsd redirect
Subject: Re:[ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

"It is not the I/O subsystem that deletes your device object, it is your

driver." Sorry, I didn’t mention that I had freed it from the fast IO
detach call. What I’m confused about is getting this call while a
request
is outstanding. Do I need to do something to handle this situation or
should this not happen. If I need to do something, what is the
convetional
way of doing this? That’s why I suggested an IO_REMOVE_LOCK, because it

does just that: keeps track of outstanding IO.

This is happening on Windows 2000 Server SP4 MP on a cluster server.
The
file system I’m attached to is NTFS. Again this is happening on a
cluster
when a disk is moved from one node to another. I’m not sure if you
would
expect the same behavior as a normal dismount.

Thanks,

Jonathan

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
What version of the OS and what file system are you seeing this on?

FAT has a bug where it deletes its device object while operations are
still in progress. These bugs in FAT have been fixed in XP and later.

Tony, I have seen you mention this before. Aside from this bug in FAT I
have never seen a FastIo detach called while there are outstanding
operations. Can you please give a scenario where you see this?

I believe it is correct to delete the device object in FastIO detach
since this is what our IFSKit samples do.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Monday, November 29, 2004 5:26 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

No, you need to stop deleting your device object prematurely. It is not
the I/O subsystem that deletes your device object, it is your driver.
My guess is that you delete it in your fast I/O detach device entry
point - but you should not do that if you have outstanding I/O
operations.

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
xxxxx@xmission.com
Sent: Monday, November 29, 2004 4:30 PM
To: ntfsd redirect
Subject: [ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

Do I need to use an IO_REMOVE_LOCK in an fs filter? I’ve got a file
system
filter that a customer is using on a cluster server. When a cluster
disk
fails over, I get an IRQL_NOT_LESS_OR_EQUAL in a completion routine for
a
close request because I try to acquire a spin lock in my device
extension,
but my device object is freed while this IRP is processed. I assume it
is
freed because the memory location for the device object is invalid and
my
driver object does not list the device object in the call stack as one
of
its device objects. Thie request is processed synchronously and the
request was not queued.

Do I need to use an IO_REMOVE_LOCK in my fs filter?


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


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

You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
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

Here is the Irp:
It is a close request.
Notice that the DO is invalid, because it has been deleted.

!irp b64b3d28 1

Irp is active with 17 stacks 16 is current (= 0xb64b3fb4)

No Mdl Thread b1837db8: Irp stack trace.

Flags = 00000404

ThreadListEntry.Flink = b1837fc4

ThreadListEntry.Blink = b1837fc4

IoStatus.Status = 00000000

IoStatus.Information = 00000000

RequestorMode = 00000000

Cancel = 00

CancelIrql = 0

ApcEnvironment = 00

UserIosb = f746fb7c

UserEvent = f746fb6c

Overlay.AsynchronousParameters.UserApcRoutine = 00000000

Overlay.AsynchronousParameters.UserApcContext = 00000000

Overlay.AllocationSize = 00000000 - 00000000

CancelRoutine = 00000000

UserBuffer = 00000000

&Tail.Overlay.DeviceQueueEntry = 00e2cf3c

Tail.Overlay.Thread = b1837db8

Tail.Overlay.AuxiliaryBuffer = 00000000

Tail.Overlay.ListEntry.Flink = 00000000

Tail.Overlay.ListEntry.Blink = 00000000

Tail.Overlay.CurrentStackLocation = b64b3fb4

Tail.Overlay.OriginalFileObject = b64eff90

Tail.Apc = 00000000

Tail.CompletionKey = 00000000

cmd flg cl Device File Completion-Context

[0, 0] 0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000

[0, 0] 0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000

[0, 0] 0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000

[0, 0] 0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000

[0, 0] 0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000

[0, 0] 0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000

[0, 0] 0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000

[0, 0] 0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000

[0, 0] 0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000

[0, 0] 0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000

[0, 0] 0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000

[0, 0] 0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000

[0, 0] 0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000

[0, 0] 0 0 00000000 00000000 00000000-00000000

Args: 00000000 00000000 00000000 00000000

[2, 0] 0 0 b6ae5810 00000000 bfe78d22-bb219ec8

b6ae5810: Could not read device object

PQV2i!VsnapFsdIrpCompletion

Args: 00000000 00000000 00000000 00000000

[2, 0] 0 e0 bb219e10 b64eff90 aca2cb50-f746fad8 Success Error Cancel

bb219e10: Could not read device object

naiavf5x

Args: 00000000 00000000 00000000 00000000

[2, 0] 0 0 bec59f10 b64eff90 00000000-00000000

bec59f10: Could not read device object

Args: 00000000 00000000 00000000 00000000

Thanks,

Jonathan

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
Jonathan,

You should not have to do anything to handle this situation. You should
not be receiving IO requests after FastIoDetach has been called. If you
do this is a bug in the system. You should talk with your Microsoft
support person and work with them to get a fix. It is possible a fix is
already available. Can you tell me what IRP you are seeing?

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jonathan Ludwig
Sent: Wednesday, December 01, 2004 8:42 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

“It is not the I/O subsystem that deletes your device object, it is your

driver.” Sorry, I didn’t mention that I had freed it from the fast IO
detach call. What I’m confused about is getting this call while a
request
is outstanding. Do I need to do something to handle this situation or
should this not happen. If I need to do something, what is the
convetional
way of doing this? That’s why I suggested an IO_REMOVE_LOCK, because it

does just that: keeps track of outstanding IO.

This is happening on Windows 2000 Server SP4 MP on a cluster server.
The
file system I’m attached to is NTFS. Again this is happening on a
cluster
when a disk is moved from one node to another. I’m not sure if you
would
expect the same behavior as a normal dismount.

Thanks,

Jonathan

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
What version of the OS and what file system are you seeing this on?

FAT has a bug where it deletes its device object while operations are
still in progress. These bugs in FAT have been fixed in XP and later.

Tony, I have seen you mention this before. Aside from this bug in FAT I
have never seen a FastIo detach called while there are outstanding
operations. Can you please give a scenario where you see this?

I believe it is correct to delete the device object in FastIO detach
since this is what our IFSKit samples do.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Monday, November 29, 2004 5:26 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

No, you need to stop deleting your device object prematurely. It is not
the I/O subsystem that deletes your device object, it is your driver.
My guess is that you delete it in your fast I/O detach device entry
point - but you should not do that if you have outstanding I/O
operations.

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
xxxxx@xmission.com
Sent: Monday, November 29, 2004 4:30 PM
To: ntfsd redirect
Subject: [ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

Do I need to use an IO_REMOVE_LOCK in an fs filter? I’ve got a file
system
filter that a customer is using on a cluster server. When a cluster
disk
fails over, I get an IRQL_NOT_LESS_OR_EQUAL in a completion routine for
a
close request because I try to acquire a spin lock in my device
extension,
but my device object is freed while this IRP is processed. I assume it
is
freed because the memory location for the device object is invalid and
my
driver object does not list the device object in the call stack as one
of
its device objects. Thie request is processed synchronously and the
request was not queued.

Do I need to use an IO_REMOVE_LOCK in my fs filter?


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


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

You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
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@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Tony,

I looked at the article, but it doesn’t talk about implementation. If I use
a ref count, what do I do at close time? Should I just block until the ref
count goes to 0? If so, would a remove lock not do exactly that? Is the
only reason to avoid a remove lock because it’s not available in pre win2k
OSes? Or am I overlooking something about remove locks? I guess I could
just use a semaphore.

Thanks,

Jonathan

“Tony Mason” wrote in message news:xxxxx@ntfsd…
Our work-around for this class of problems (which we’ve seen with both
FAT and NTFS, although I know Neal, et. al. have changed FAT at least to
try and eliminate these) is to reference count our device object.

We actually discussed this situation on OSR Online
(http://www.osronline.com/article.cfm?id=34) and described the basic
technique we have seen.

We have see the “device object goes away before the IRP is completed”
issue with respect to removable media, autochk, and in cluster
configurations like you describe, with both FAT and NTFS. While I
appreciate that Microsoft will fix such problems, as found and reported,
our approach at OSR has always been to make it work for all versions of
the OS. There are always customers that cannot (or will not) upgrade to
the latest versions of the OS, service pack, etc. Many of you still
have NT 4.0 customers (why move off a stable “reliable” base?)

I hope this helps.

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 Jonathan Ludwig
Sent: Wednesday, December 01, 2004 11:42 AM
To: ntfsd redirect
Subject: Re:[ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

“It is not the I/O subsystem that deletes your device object, it is your

driver.” Sorry, I didn’t mention that I had freed it from the fast IO
detach call. What I’m confused about is getting this call while a
request
is outstanding. Do I need to do something to handle this situation or
should this not happen. If I need to do something, what is the
convetional
way of doing this? That’s why I suggested an IO_REMOVE_LOCK, because it

does just that: keeps track of outstanding IO.

This is happening on Windows 2000 Server SP4 MP on a cluster server.
The
file system I’m attached to is NTFS. Again this is happening on a
cluster
when a disk is moved from one node to another. I’m not sure if you
would
expect the same behavior as a normal dismount.

Thanks,

Jonathan

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
What version of the OS and what file system are you seeing this on?

FAT has a bug where it deletes its device object while operations are
still in progress. These bugs in FAT have been fixed in XP and later.

Tony, I have seen you mention this before. Aside from this bug in FAT I
have never seen a FastIo detach called while there are outstanding
operations. Can you please give a scenario where you see this?

I believe it is correct to delete the device object in FastIO detach
since this is what our IFSKit samples do.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Monday, November 29, 2004 5:26 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

No, you need to stop deleting your device object prematurely. It is not
the I/O subsystem that deletes your device object, it is your driver.
My guess is that you delete it in your fast I/O detach device entry
point - but you should not do that if you have outstanding I/O
operations.

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
xxxxx@xmission.com
Sent: Monday, November 29, 2004 4:30 PM
To: ntfsd redirect
Subject: [ntfsd] Do I need to use an IO_REMOVE_LOCK in an fs filter?

Do I need to use an IO_REMOVE_LOCK in an fs filter? I’ve got a file
system
filter that a customer is using on a cluster server. When a cluster
disk
fails over, I get an IRQL_NOT_LESS_OR_EQUAL in a completion routine for
a
close request because I try to acquire a spin lock in my device
extension,
but my device object is freed while this IRP is processed. I assume it
is
freed because the memory location for the device object is invalid and
my
driver object does not list the device object in the call stack as one
of
its device objects. Thie request is processed synchronously and the
request was not queued.

Do I need to use an IO_REMOVE_LOCK in my fs filter?


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


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

You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
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