Problem with Oplocks

Hi, all

I write a filter driver in which read file operation is performed within
dispatch create.

I installed the driver on a server and then try to access the files on this
server through CIFS from clients.

Then Problem emerges. The connection between clients and server is lost and
can’t be built any more unless the server is rebooted.

I think the problem may be related with the Oplocks coming with CIFS, cuz
the filter driver works well in the server while accessing

files on server locally.

I use "IoCreateFileSpecifyDeviceObjectHint " to get handle of a file and
then use “ZwReadFile” to get the contents of it in dispatch

create routine.

Would anybody please explain to me what the problem actually is and how to
solve it?

Thanks a million!

Why do you believe it is related to oplocks? This suggests that perhaps
there’s something else going on that you have observed but do not
mention.

Nevertheless, let’s assume you are right. Are you calling
IoCreateFileSpecifyDeviceObjectHint in the context of an IRP_MJ_CREATE
operation? If so, is the FILE_COMPLETE_IF_OPLOCKED flag set in the IRP?
If it is, are you also setting this flag when you try to open the file
using IoCreateFileSpecifyDeviceObjectHint? If not, this would create a
deadlock under some circumstances, such as those that you describe.

Of course, the only way to tell if this is the case is to debug the
server system.

Regards,

Tony

Tony Mason

Consulting Partner

OSR Open Systems Resources, Inc.

http://www.osr.com


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Xiong Weiwei
Sent: Tuesday, May 09, 2006 11:59 AM
To: ntfsd redirect
Subject: [ntfsd] Problem with Oplocks

Hi, all

I write a filter driver in which read file operation is performed within
dispatch create.

I installed the driver on a server and then try to access the files on
this server through CIFS from clients.

Then Problem emerges. The connection between clients and server is lost
and can’t be built any more unless the server is rebooted.

I think the problem may be related with the Oplocks coming with CIFS,
cuz the filter driver works well in the server while accessing

files on server locally.

I use "IoCreateFileSpecifyDeviceObjectHint " to get handle of a file and
then use “ZwReadFile” to get the contents of it in dispatch

create routine.

Would anybody please explain to me what the problem actually is and how
to solve it?

Thanks a million!
— 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