Windows clients will not refresh Linux samba file locally if reading file at intervals <= 10 seconds

The default values for the relevant settings are:

  • oplocks = yes
  • kernel oplocks = no

(See Samba smb.conf documentation)


You can disable oplocks, as per another answer.

Alternatively, if you are running a Linux O/S with a modern kernel (2.4 or newer), you can leave oplocks = yes and instead add a line to smb.conf to enable kernel oplocks. As per kernel oplocks (S) section in documentation:

Kernel oplocks support allows Samba oplocks to be broken whenever a local UNIX process or NFS operation accesses a file that smbd(8) has oplocked. This allows complete data consistency between SMB/CIFS, NFS and local file access

When oplocks and kernel oplocks are both enabled, you should get good performance (from caching) and cache invalidation when the files are updated.

To enable kernel oplocks, add this line to your Samba configuration file:

kernel oplocks = yes

I resolved this by placing

oplocks = False

in my smb.conf under my share settings.

https://www.samba.org/samba/docs/old/Samba3-HOWTO/locking.html#id2615926