As more and more people start to deploy a new VNX and switch to an advanced windows server operating system, I am seeing a higher utilization of the SMB2 protocol for cifs. With this increase, comes new problems. Recently I had noticed a rather peculiar notification in the server logs in regards to CAVA. CAVA was reporting the error “FILE_NOT_FOUND” on scans when the file existed. It would present itself as something like this:
2012-04-29 08:49:47: 81878122528: VC: 3: 32: Server ‘192.168.1.156’ returned error ‘FILE_NOT_FOUND’ when checking file ‘\root_vdm_2\CIFS\Test\1234.exe’
The standard troubleshooting confirmed that the file did exist. I even back traced it from the CAVA server through the “check$” share and did not have any problems with the file. So why was CAVA reporting errors like this so often? It turns out the problem was not with CAVA itself, but with an “enhancement” introduced as part of SMB2.
As part of the SMB2 protocol, the Microsoft Redirector uses a local cache for directory metadata. This cache is usually cleared after 10 seconds. What this does, in instances of file systems with a high rate of change, is cause an inconsistency with what the CAVA server sees when it goes to scan a file. The CAVA server will actually read from the cache and error out when the file is not found in it. This then causes the error that I pasted above.
Of course with a problem, comes a work around. This was identified and placed into the latest VNX Event Enabler release notes, but I will provide it for you here:
- Open the Windows Registry Editor and navigate to HKLM\SystemCurrentControlSet\Services\LanmanWorkstation\Parameters.
- Right-click Parameters and select New > DWORD Value.
- For the new REG_DWORD entry, type a name of DirectoryCacheLifetime.
- Set the value to 0 to disable DirectoryCacheLifetime.
- Click OK.
- Restart the machine.
A simple registry change on each CAVA server and a reboot will allow you to set the cache lifetime value to 0 and thus there will be no more caching. After this change you should not see any more problems caused by SMB2.