Windows Explorer dir refresh and change notifications

Uri Simchoni uri at
Tue Nov 8 12:15:29 UTC 2016

On 11/08/2016 11:24 AM, Raghavendra Talur wrote:
> On Tue, Nov 8, 2016 at 2:39 PM, Volker Lendecke <vl at> wrote:
>> On Tue, Nov 08, 2016 at 09:56:51AM +0200, Uri Simchoni wrote:
>>> It seems that in Windows (at least Win7), if you have an explorer window
>>> open on a directory, then propagation of changes depends on a working
>>> change-notify mechanism.
>>> I used to think you only need change-notify for the window to be
>>> refreshed *automatically*, but it seems like even hitting F5 doesn't
>>> show new files (for a varying time in the order of one minute), if
>>> change notify doesn't work (as with the case of a FUSE file system
>>> without change notify support).
>>> Is anyone familiar with this? Is it an Explorer behavior or a redirector
>>> behavior? Can anything be done short of fixing change-notification?
>> I can confirm I've seen that. Working change notify seems mandatory
>> for the Windows Explorer application these days. I do not know about
>> any client-side workaround.
>> Volker
> We have seen that too. The following is the summary that Michael
> arrived at when we debugged the issue.
> It seems that in at least in some versions of win7 and win8, there is
> a bug with smb2 notify in combination with oplocks.
> with win7 (unpatched) we could repro the issue against samba 4.2
> but using SMB1 the issue went away
> using SMB 2.1 and turning off oplocks, the issue was not there either
> using SMB 2.1 and enabling smb2 leases, the issue was not there either
> with windows 2012r2, (~ win 8.1) the issue was never seen.
> You could try turning off oplocks OR turning on smb2 leases as a workaround.
> Thanks,
> Raghavendra Talur

Thanks Volker and Raghavendra,

We've tried both the leases and the oplocks, and while it does seem to
change things, it does not completely remove the issue. The report I get
from the developer working on it is that the following scenario
reproduces the issue:

1. Create a folder using libsmbclient SMB1 (that's some KDE desktop thing)
2. Open that folder using Windows Explorer from Win7
3. Add a file from smbclient
4. File does not pop up in Windows explorer, even after refreshing, for
about a minute.

Capture shows that no change notify is sent, and that each refresh
causes the Windows machine to open the folder (Create) and close the
handle, without listing its content. The timestamps change when files
are added.

This is peculiar because in this case, change-notify doesn't work even
for an all-samba case, where the inotify doesn't work. I would think
this is covered by messaging, unless there's an optimization that avoids
messaging because inotify should do it.

We'll keep investigating....


More information about the samba-technical mailing list