Microsoft KB Archive/320310

= The Windows Redirector May Cancel a Session During a Long Locking Operation =

Article ID: 320310

Article Last Modified on 2/22/2007

-

APPLIES TO


 * Microsoft Windows 2000 Service Pack 1
 * Microsoft Windows 2000 Service Pack 2
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Service Pack 1
 * Microsoft Windows 2000 Service Pack 2
 * Microsoft Windows XP Professional

-



This article was previously published under Q320310



SYMPTOMS
The Windows redirector may incorrectly cancel a session during long-lasting locking operations. This problem may occur in the following scenario:
 * Client A locks a file on the file server.
 * Client B also tries to lock the same file by calling the LockFileEx(hFile,LOCKFILE_EXCLUSIVE_LOCK,...) function.
 * The file server never returns the SMB call to client B because client A still has the file locked.
 * The client B redirector times out and disconnects the session. (The time-out period is controlled by the Sesstimeout registry setting.)



CAUSE
If the LOCKFILE_FAIL_IMMEDIATELY flag in the LockFileEx function is not set, the server returns only when the file has been successfully locked. This is by design. If this takes longer than the client-side session time-out, the client's redirector cancels the connection.



Windows 2000
To resolve this problem, obtain the latest service pack for Windows 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

260910 How to Obtain the Latest Windows 2000 Service Pack

The English version of this fix should have the following file attributes or later:   Date         Time      Version        Size     File name -  11-Mar-2002  13:14:40  5.0.2195.5059  370,480  Mrxsmb.sys 07-Mar-2002 13:16:30  5.0.2195.5042  131,920  Rdbss.sys

The fix is to treat the SMB Lock & X command as a long-standing SMB. This makes the command exempt from the Sesstimeout timer. The redirector will wait as long as it must.

Windows XP
To resolve this problem, obtain the latest service pack for Windows XP. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

322389 How to Obtain the Latest Windows XP Service Pack



WORKAROUND
To work around this problem, use LockFileEx(,,LOCKFILE_FAIL_IMMEDIATELY) instead of LOCKFILE_EXCLUSIVE_LOCK. The LOCKFILE_FAIL_IMMEDIATELY flag returns with an appropriate error if the file is already in use. The program can programmatically try to lock the file again later.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft Windows 2000 Service Pack 3 (SP3) and Microsoft Windows XP Service Pack 1 (SP1).



MORE INFORMATION
For additional information about how to obtain a hotfix for Windows 2000 Datacenter Server, click the article number below to view the article in the Microsoft Knowledge Base:

265173 The Datacenter Program and Windows 2000 Datacenter Server Product

For additional information about how to install multiple hotfixes with only one reboot, click the article number below to view the article in the Microsoft Knowledge Base:

296861 Use QChain.exe to Install Multiple Hotfixes with One Reboot

Additional query words: kbBaseOS

Keywords: kbbug kbfix kbwin2000presp3fix kbqfe kbwin2000sp3fix kboswin2000fix kbwinxpsp1fix kbhotfixserver KB320310

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.