-1

I have the following linux environment configuration Machine 1: Samba server

[share]
    comment = Data
    path = /share
    force create mode = 0777
    force directory mode = 0777
    force user = root
    force group = root
    writeable = Yes
    read only = No
    guest ok = Yes

Machine 2: mount point to machine 1 share folder, using autofs service. auto.app file content :

/store -fstype=cifs,cache=none,forcedirectio,noac ://machine1/share 

Machine 3: mount point to machine 1 share folder, using autofs service. auto.app file content :

/store -fstype=cifs,cache=none,forcedirectio,noac ://machine1/share

The problem that I'm facing is that if i'm updating a file under /store folder on machine 2, it will take a couple of seconds(~5 seconds) for the changes to become available on /store folder under machine 3. I want the changes to become available right away on machine 3. I don't care about any performance implications.

It looks like a caching problem to me, but i couldn't find a way to disable this so far. What i've tried so far was to pass the cache=none,forcedirectio,noac parameters but no success.

Any ideas?

Thanks

Yonoss
  • 1,242
  • 5
  • 25
  • 41

2 Answers2

1

I know it's late, but on RHEL 5.8, we got the caching disabled on a system level by echo 0 > /proc/fs/cifs/LookupCacheEnabled.

LookupCacheEnabled file has the CIFS coniguration for the no of seconds to wait before refreshing the cache. By setting the value to 0, you will disable the cache. Hope it helps someone.

Anwar Husain
  • 1,414
  • 14
  • 19
0

The way I've solved the caching issue was to drop samba and install nfs

Yonoss
  • 1,242
  • 5
  • 25
  • 41