When a file is placed on a Samba share, it isn't shown for a while on other Windows machines, when they have this folder already open in explorer. Steps to reproduce: - On a Windows workstation: Open a directory on a Samba server in Windows Explorer. You will see the content, if there's any. Leave the window opened. - On the Samba server or on a different workstation: Navigate to exactly this directory and download a new file to that folder. - On the Windows workstation again: The new file does not appear. Even if you press [F5]. After a some minutes, the file appears. (This are the steps I've done in the attached level 10 debug log file and the wireshark capture. The file I downloaded on the server to that folder and doesn't appear on windows was "test.log". The folder I used for testing was \\genome\homedirs\muehlfeld\Downloads\). Further steps: - Delete the file on windows. It's gone (like expected). - Leave the directory open in Windows explorer. - Download the file on the server again to that folder. - The file appears directly if you press [F5] on the windows machine. - Remove the file again. - Close the Windows Explorer, reopen it and navigate again to that folder. - Download the file on the server again to that folder. - The file isn't shown again for a while. Additional information: - I can reproduce this on Windows 7 64-Bit with all updates (32-Bit not tested), but not on XP. - It was reproducable against some (not all) of my 3.6.18 and 3.6.19 member servers. I attached the smb.conf from one of these machines. - I could not reproduce it on my 4.0.9 DC (don't have 4.x members in production yet).
Created attachment 9252 [details] level 10 debug log
Created attachment 9253 [details] wireshark capture
Created attachment 9254 [details] smb.conf
The problem is even greater if somebody renames a file or folder. Then on other machines, the file/folder is sometimes shown with it's old name (but of course not accessable any more) or completely gone for a time.
Something more that I have discoverd: If client A has folder X openend and client B add/rename a file or directory, then the changes are not visible on client A for some time. But when client A does any change in the same folder (like delete some other file) and presses [F5] then, the change from client B appears (but only if [F5] was pressed afterwards). Only pressing [F5] doesn't work. It looks like the client doesn't request for the new directory content on a normal refresh.
I found out the following: When I remove max protocol = SMB2 from my smb.conf and restart Samba, the problem seems to be gone (but I had to restart my Win7 workstation, too). If the problem is related to SMB2, this would explain, why I didn't had this issue on XP machines (SMB2 was introduced in Vista).
I got a hint on the mailing list, that this problem is based on SMB2 caching in Windows7: Am 06.10.2013 09:02, schrieb Jones: > Sometimes this symptom happened in my environment, > and found this link: > SMB2 Client Redirector Caches Explained > http://technet.microsoft.com/zh-tw/library/ff686200(v=ws.10).aspx > > Here is one test case, > during Windows 7 and Samba are negotiated with >= protocol SMB 2.0, > Windows 7 might cache the directory entries, > i.e. the directory entries are locally satisfied by Windows 7, > and there are no SMB2 packets across network while refreshing the list thru > powershell dir command, > hence Windows 7 with Wireshark captures no packets. > > After following 3 DWORDs are applied to Windows 7 and reboot is required, > this symptom seems no longer exist in my environment. > Not sure is this a acceptable change but hope this help. > FileInfoCacheLifetime = 0 > FileNotFoundCacheLifetime = 0 > DirectoryCacheLifetime = 0 If I add this three values to my registry and reboot, the problem is immediately gone. So this bug report can be closed, as it isn't a Samba bug.