If I have a windows client read a file on a Linux smb share at an interval <= 10 seconds, the windows client will show incorrect (cached?) information of that file.
I've reproduced this on multiple systems.
Example steps to reproduce:
1) set up linux samba share - for this example, using Debian and installing samba. example:
sudo mkdir /test sudo chmod 777 /test
[test] read only = no locking = no path = /test/ guest ok = yes
2) Map this directory as a drive in a windows client (this test will use L:)
3) create a file with some text on the samba server
nano /test/test.txt ORIGINAL
4) create simple batch file on windows machine to view file every 5 seconds:
copy con test.bat @echo off cls :1 type L:\test.txt timeout 5 goto 1
5) run batch file, it should show ORIGINAL every 5 seconds.
6) on linux server, change file contents
nano /test/test.txt CHANGED
7) view the running batch file on windows, it will still say "ORIGINAL" every five seconds, and not "CHANGED" as the real file has.
8) terminate the batch file and wait ~ 15 seconds, OR change timeout to something > 10 seconds, and it will update properly.
Hopefully I've explained and outlined how to test this sufficiently.
Can anyone reproduce this behavior and/or suggest how to fix this?
Linux Client > Linux SMB Host shows the proper file content.
Windows Client > Windows SMB Host shows the proper file content.
It's specifically Windows Client > Linux SMB Host that does not show the proper file content at a refresh interval of <= 10 seconds.
All Windows flavors I've tested with (Win7, Win10, Server2016) exhibit the same behavior.
I have also tested different protocols on my samba share 'NT1, SMB2, SMB3', and they do not change the behavior.
NOTE: I believe this is most likely a Windows issue, but I have not received any responses on either technet or superuser in a week. This should be fairly easy to test, can anyone confirm this behavior or state otherwise?