5

I know it sounds like a programming question but it's actually not. Bear with me please:

I have a customer who is experiencing a strange issue that I cannot explain: a program uses a file on a shared SMB drive (Windows 2008R2 server) open in shared mode.

Before performing an update inside the file, the program will lock specific potions using LockFile, read the data, write the required changes to these portions and then unlock them.

This is done to ensure that several instances of the same program can overwrite each other's changes.

In my customer case, this program (which behaved perfectly well for years in all other locations) succeeds in locking the file but the subsequent call to ReadFile on the same handle fails and GetlastError returns error 64 The specified network name is no longer available

Thus, my question:

Is there some setting in the windows SMB client or server that could cause something like this ?

It looks like an optimistic lock to me but windows doesn't do optimistic locks by default (it does opportunistic locks).

My first suspicion is that this problem is cause by the anti-virus software (Kaspersky) but the site admin swear that all AVs have an exclusion for this network path, both on client and on the file server.

The client OS is a mix of Windows XP, 7, 2003 and 2008R2 (via terminal services). It seems to happen only in time of heavy load (in the morning when everyone comes in or in he evening when everyone logs out).

4
  • If you truly suspect that it might be your antivirus software's fault (which is a suspicion that I would share with you,) why don't you try disabling it and see if the problem goes away?
    – Ryan Ries
    Jul 24, 2013 at 15:40
  • I'd do that if I could. The relation with the site admin (an external service company) is a bit "tense" though, and my initial proposal to disable it were answered by a rather direct "no, we can't do that".
    – Stephane
    Jul 24, 2013 at 15:48
  • I know your situation very well. Unfortunately, AV is notorious for locking files even when "we swear the whole directory is excluded!" So that's really the 800-pound gorilla in the room until we can definitively eliminate it as the cause.
    – Ryan Ries
    Jul 24, 2013 at 15:55
  • I agree but what I'm actually asking is if there is a way to configure a windows SMB client (or server) to behave like this.
    – Stephane
    Jul 25, 2013 at 7:19

2 Answers 2

1

Well, the answer was much simpler than I thought: a faulty device driver for the server's NIC apparently was the cause of all these trouble.

0

This really IS a programming problem IMHO but it may be reverted back to the way it 'worked' before by downgrading your OS. Windows 7 introduced a new locking mech into CIFS which is almost certainly the cause of your issue. This means you either need to update the program to work with the new lock scheme (programming prob) or you need to downgrade or find a compatibility fix (admin problems).

http://en.wikipedia.org/wiki/Server_Message_Block

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .