Automatic refresh on file creation/delete for CIFS

Status
Not open for further replies.

achianese

Dabbler
Joined
Oct 25, 2013
Messages
20
Hi,

I've created a CIFS share that seems work well in most respects, but there's one issue I can't seem to fix after doing some research and playing with settings a fair amount. When a client has an explorer window open and a change happens in that directory (file created, deleted), I think the change should immediately appear in the explorer window. This works if I serve a shared folder from Windows 7 and watch it on a Windows 7 client, but it doesn't work if I watch my FreeNAS shared folder from my Windows 7 client.

Has anyone else had this problem and figured out how to fix it? I'm running FreeNAS-9.1.1-RELEASE-x64 (a752d35).

Thanks,
Anthony
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526

achianese

Dabbler
Joined
Oct 25, 2013
Messages
20
Thanks. I found that link too. Making that change has no effect for me. I added "refresh = 1" to the Auxiliary Parameters for the CIFS service, and confirmed that it did add the "refresh = 1" line to /etc/local/smb.conf. This doesn't cause the shared folders to automatically update for me though.

On the other hand, it looks like I wasn't using the most practically relevant test for this behavior. I was watching my Windows Explorer window while creating and deleting files using touch and rm over ssh. However, I've found that if I use 2 Windows clients, a file change caused by one client is immediately observed in the other client's Explorer window. This works whether "refresh = 1" is used or not. So it appears the default behavior is that samba immediately notifies CIFS clients of changes that are initiated by a CIFS client, but doesn't immediately notice other changes to the filesystem, so an F5 refresh is required.

There's another option called "kernel change notify", which is supposed to default to yes. I tried adding that in, and saw no effect.

Anyway, I guess I'm ok as long as clients can see changes initiated by other CIFS clients. Other kinds of changes should be infrequent enough. Still, this is a curious behavior.
 
Status
Not open for further replies.
Top