Microsoft KB Archive/328858

= FIX: Size of NFS Directory Always 64 Bytes or Lock Requests With No Authentication Credentials Do Not Succeed =

Article ID: 328858

Article Last Modified on 10/19/2005

-

APPLIES TO


 * Microsoft Windows Services for Unix 2.2

-



This article was previously published under Q328858



SYMPTOMS
The major issues addressed by this patch are:
 * Directory sizes on Network File System (NFS) shares are always shown as 64 bytes when viewed from NFS clients.
 * Lock requests with no authentication credentials are not honored by Server for NFS.
 * The message that the lock is granted returns an incorrect value for the length of the file when the whole file is locked.



RESOLUTION
A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

Date       Time      Size     File name --- 11-SEP-2002 15:56     78,336  clilocks.dll 11-SEP-2002 15:56    394,240  clilocks.pdb 11-SEP-2002 15:04     31,744  clusnfs.exe 11-SEP-2002 15:04    246,784  clusnfs.pdb 11-SEP-2002 15:04     24,064  nfsonly.exe 11-SEP-2002 15:04    246,784  nfsonly.pdb 11-SEP-2002 15:04     66,048  nfssh.dll 11-SEP-2002 15:04    558,080  nfssh.pdb 11-SEP-2002 15:59     88,064  nfsshare.exe 11-SEP-2002 15:59    386,048  nfsshare.pdb 11-SEP-2002 15:04    143,360  nfsshEx.dll 11-SEP-2002 15:04  1,418,240  nfsshEx.pdb 11-SEP-2002 15:04    113,664  nfssprop.dll 11-SEP-2002 15:04    443,392  nfssprop.pdb 11-SEP-2002 15:04     94,208  nfssvc.exe 11-SEP-2002 15:04    525,312  nfssvc.pdb 11-SEP-2002 15:04  1,672,192  nfssvr.pdb 11-SEP-2002 15:04    321,184  nfssvr.sys 11-SEP-2002 15:04    271,360  portmap.pdb 11-SEP-2002 15:04     40,832  portmap.sys 15-MAR-2002 18:13     56,080  reg.exe 08-MAR-2002 18:15        697  reg.txt 14-DEC-2001 12:01     35,600  regini.exe 11-SEP-2002 15:04    394,240  rpcxdr.pdb 11-SEP-2002 15:04     72,800  rpcxdr.sys 06-APR-2002 02:33     27,102  supphelp.chm 11-SEP-2002 15:04     48,128  upNFS3.exe 11-SEP-2002 15:04    345,088  upNFS3.pdb



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
Windows file systems represent directories very differently from UNIX file systems:
 * In UNIX, directories are represented by files on the disk and have a file size.
 * In Windows, directories are not represented by files on the disk.

As a result, when you query for the size of a directory, Server for NFS returns the default value of 64 bytes.

Some UNIX applications are written to take advantage of the file size of UNIX directories. These programs may allocate internal buffers based on this information. These programs may spuriously fail (perform a &quot;core dump&quot;) when using data from Server for NFS.

You can change the size of directory that is reported by Server for NFS by changing the default value (64 bytes) in the following registry key: 

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NfsSvr\Parameters\DefaultDirSize

NOTE: Changing the value of this key does not change or limit the size of a directory on an NFS share in any way. It only changes the reported size of a directory. When viewed through NFS clients, the size of the directories that is displayed depends on the value in the registry key:
 * If less than or equal to 64 bytes, the size of directories appears as 64 bytes.
 * If greater than 64 bytes, the size for all directories appears as this greater-than-64-bytes value.

After you restart the server, it reports the new size.

Lock Requests With No Authentication Credentials
Server for NFS does not honor lock requests that do not have authentication credentials.

To allow NFS clients to lock files without providing any authentication credentials, Server for NFS has been modified to support advisory locks.

To support advisory locks, set the following registry value to zero to disable mandatory locks:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NfsSvr\NlmNsm\EnableSMBLocking

CAUTION: Setting this registry value turns off mandatory locks only for NFS lock requests. Windows applications continue to use mandatory locks. As a result, if one NFS client obtains a read/write lock on a file, other NFS clients that are also using NLM locks before accessing a file for read/write will honor that lock. However, any Windows application can still modify the file, either through a Common Internet File System (CIFS) share, or when running on the computer where the file is located, because advisory locks do not actually lock the file on the server. Additionally, although an NFS client may have obtained a lock on a file, a Windows application (either running locally or accessing the file through a CIFS share) can get a mandatory lock on the file, thereby preventing the NFS client from accessing the file, even though the NFS client has a read/write lock on the file.

Lock Granted Message After Whole File Locked
After locking the whole length of a file, Server for NFS sends a message that the lock is granted to the client that requested the lock. Server for NFS now returns zero (0) as the length of the locked file, per the Network Lock Manager (NLM) protocol.

