[Samba] oplock not working correctly

Iain iain at mein.it
Thu Apr 27 11:21:18 GMT 2006


I posted a problem with oplock previously, but am guessing it goto lost
in an earlier thread with the same subject line, so here goes another shot:

Using Samba 3.0.22 on a Gentoo box (kernel 2.6.15) I've a situation
where file locking does not seem to be functioning as expected, in that
more than one user can open and write to a file without any
notifications being displayed about the file already being opened by
another user.

In the debug output below I have two Windows XP clients accessing the
same shared file, neteng02 has the file open. neteng-vm3 then opens the
same file, receiving no warnings about the file being open by another
user. File is modified by neteng02 and saved and remains open. File then
modified by neteng-vm3 and saved. File closed and opened by neteng02 who
sees only modifications made by neteng-vm3.

*** START ***
log.neteng-vm3:[2006/04/26 11:33:57, 3]
smbd/oplock_linux.c:linux_set_kernel_oplock(166)
log.neteng-vm3:  linux_set_kernel_oplock: got kernel oplock on file
tmp/my_test_file.txt, dev = 804, inode = 251750772, file_id = 225
log.neteng-vm3:[2006/04/26 11:33:57, 5] smbd/oplock.c:set_file_oplock(125)
log.neteng-vm3:  set_file_oplock: granted oplock on file
tmp/my_test_file.txt, dev = 804, inode = 251750772, file_id = 225,tv_sec
= 444f3e85, tv_usec = 88676
log.neteng-vm3:[2006/04/26 11:33:57, 3]
smbd/oplock.c:initial_break_processing(311)
log.neteng-vm3:  Current oplocks_open (exclusive = 0, levelII = 1)
log.neteng02:[2006/04/26 11:33:57, 3]
smbd/oplock.c:initial_break_processing(311)
log.neteng02:  Current oplocks_open (exclusive = 1, levelII = 0)
log.neteng02:[2006/04/26 11:33:53, 3]
smbd/oplock_linux.c:linux_set_kernel_oplock(166)
log.neteng02:  linux_set_kernel_oplock: got kernel oplock on file
tmp/my_test_file.txt, dev = 804, inode = 251750772, file_id = 458
log.neteng02:[2006/04/26 11:33:53, 5] smbd/oplock.c:set_file_oplock(125)
log.neteng02:  set_file_oplock: granted oplock on file
tmp/my_test_file.txt, dev = 804, inode = 251750772, file_id = 458,tv_sec
= 444f3e81, tv_usec = d7ef7
*** END ***

My smb/conf file looks like:

*** START ***
[global]
  netbios name  = NETMON2
  workgroup     = MYCORP
  server string = LDAP PDC
  hosts allow   = 172.16.0.0/19

  security = user
  encrypt passwords = yes
  socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
  interfaces = lo eth0
  bind interfaces only = yes
  local master = yes
  os level = 65
  domain master = yes
  domain logons = yes
  preferred master = yes
  null passwords = no
  hide unreadable = yes
  hide dot files = yes
  logon script = %U.bat
  logon drive = H:
  logon home = \\%L\%U
  wins support = yes

  name resolve order = wins lmhosts host bcast
  dns proxy = yes
  time server = yes

  log file = /var/log/samba/log.%m
  max log size = 50
  log level = 5

  add user script = /usr/sbin/smbldap-useradd -m "%u"
  add machine script = /usr/sbin/smbldap-useradd -w "%u"
  add group script = /usr/sbin/smbldap-groupadd -p "%g"
  add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g"
  delete user from group script = /usr/sbin/smbldap-groupmod -x "%u" "%g"
  set primary group script = /usr/sbin/smbldap-usermod -g "%g" "%u"

  passdb backend = ldapsam:ldap://127.0.0.1/

  ldap delete dn = Yes
  ldap ssl = no
  ldap suffix = dc=waldocorp,dc=com
  ldap admin dn = cn=Manager,dc=waldocorp,dc=com
  ldap group suffix = ou=Groups
  ldap user suffix = ou=Users
  ldap machine suffix = ou=Computers
  ldap idmap suffix = ou=Users

  printcap name = cups
  load printers = yes
  printing = cups

  admin users = @"Domain Admins"

  kernel oplocks = yes
  oplocks = yes
  level2 oplocks = yes
  strict locking = yes

[printers]
  comment = All Printers
  path = /var/spool/samba
  browseable = yes
  guest ok = yes
  writable = no
  printable = yes
  create mode = 0700
  default devmode = yes

[print$]
  comment = Printer Driver Download Area
  path = /home/samba/printers
  browseable = yes
  read only = yes
  write list = @"Domain Admins"
  guest ok = yes

[netlogon]
  path = /home/samba/netlogon
  guest ok = yes
  browseable = no
  write list = root

[profiles]
  path = /home/samba/profiles
  writeable = yes
  browseable = no
  read only = no
  create mode = 0644
  directory mode = 0755
  guest ok = yes

[homes]
  path = /home/samba/users/%U
  browseable = no
  valid users = %S
  read only = no
  create mask = 0664
  directory mask = 0775

[software]
  comment = Software Repository
  path = /home/samba/software
  guest ok = no
  public = yes
  read only = no
  browseable = yes
  force create mode = 0775
  force directory mode = 6775

[engineering]
  comment = Network Engineering Group Share
  path = /home/samba/groups/engineering
  guest ok = no
  public = yes
  read only = no
  browseable = yes
  force create mode = 0775
  force directory mode = 6775

[finance]
  comment = Finance Group Share
  path = /home/samba/groups/finance
  guest ok = no
  public = yes
  read only = no
  browseable = yes
  force create mode = 0775
  force directory mode = 6775

[labs]
  comment =  Labs Group Share
  path = /home/samba/groups/labs
  guest ok = no
  public = yes
  read only = no
  browseable = yes
  force create mode = 0775
  force directory mode = 6775

[support]
  comment = Support Group Share
  path = /home/samba/groups/support
  guest ok = no
  public = yes
  read only = no
  browseable = yes
  force create mode = 0775
  force directory mode = 6775

*** END ***

Any ideas why the files are not being locked correctly??

Iain.




More information about the samba mailing list