[Samba] File locking issue

Yan Seiner yan at seiner.com
Mon Aug 6 21:09:16 GMT 2007


I have a client with an older server that is running into a weird file 
locking problem.

The server is running FC2, samba 3.0.7 and kernel 2.6.10.

They have recently installed AutoDesk Revit, which is apparently some 
sort of collaborative design software.  Revit keeps a central repository 
and then allows different clients to access it.

What is happening is that only the person who created the file has 
read/write access to it - even after s/he closes the file.

Here's a log from the workstation that creates the file.  From what I 
understand, the user 'johan' created the file and then tested read/write 
ability.

[2007/08/06 16:09:42, 3] smbd/dosmode.c:unix_mode(111)
  unix_mode(REVIT/test-08-06-07/Martini-central.rvt) returning 0777
[2007/08/06 16:09:42, 3] smbd/open.c:open_file(178)
  Error opening file REVIT/test-08-06-07/Martini-central.rvt (No such 
file or directory) (local_flags=0) (flags=0)
[2007/08/06 16:09:42, 3] smbd/error.c:error_packet(105)
  error string = No such file or directory
[2007/08/06 16:09:42, 3] smbd/error.c:error_packet(145)
  error packet at smbd/trans2.c(2229) cmd=45 (SMBopenX) eclass=1 ecode=2
[2007/08/06 16:09:42, 3] smbd/process.c:process_smb(1092)
  Transaction 8503 of length 110
[2007/08/06 16:09:42, 3] smbd/process.c:switch_message(887)
  switch message SMBopenX (pid 5543) conn 0x949fd30
[2007/08/06 16:09:42, 3] smbd/dosmode.c:unix_mode(111)
  unix_mode(REVIT/test-08-06-07/Martini-central.rvt) returning 0777
[2007/08/06 16:09:42, 2] smbd/open.c:open_file(245)
  johan opened file REVIT/test-08-06-07/Martini-central.rvt read=No 
write=Yes (numopen=3)
[2007/08/06 16:09:42, 3] smbd/sec_ctx.c:set_sec_ctx(288)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2007/08/06 16:09:42, 3] smbd/process.c:process_smb(1092)
  Transaction 8504 of length 41
[2007/08/06 16:09:42, 3] smbd/process.c:switch_message(887)
  switch message SMBgetattrE (pid 5543) conn 0x949fd30
[2007/08/06 16:09:42, 3] smbd/sec_ctx.c:set_sec_ctx(288)
  setting sec ctx (501, 500) - sec_ctx_stack_ndx = 0
[2007/08/06 16:09:42, 3] smbd/reply.c:reply_getattrE(5066)
  reply_getattrE fnum=9807
[2007/08/06 16:09:42, 3] smbd/process.c:process_smb(1092)
  Transaction 8505 of length 41
[2007/08/06 16:09:42, 3] smbd/process.c:switch_message(887)
  switch message SMBgetattrE (pid 5543) conn 0x949fd30
[2007/08/06 16:09:42, 3] smbd/reply.c:reply_getattrE(5066)
  reply_getattrE fnum=9807
[2007/08/06 16:09:42, 3] smbd/process.c:process_smb(1092)
  Transaction 8506 of length 45
[2007/08/06 16:09:42, 3] smbd/process.c:switch_message(887)
  switch message SMBclose (pid 5543) conn 0x949fd30
[2007/08/06 16:09:42, 3] smbd/reply.c:reply_close(2778)
  close fd=27 fnum=9807 (numopen=3)
[2007/08/06 16:09:42, 2] smbd/close.c:close_normal_file(262)
  johan closed file REVIT/test-08-06-07/Martini-central.rvt (numopen=2)
[2007/08/06 16:09:42, 2] smbd/close.c:close_normal_file(262)
  johan closed file REVIT/test-08-06-07/Martini-central.rvt (numopen=2)
[2007/08/06 16:09:42, 3] smbd/process.c:process_smb(1092)
  Transaction 8507 of length 110
[2007/08/06 16:09:42, 3] smbd/process.c:switch_message(887)
  switch message SMBopenX (pid 5543) conn 0x949fd30
[2007/08/06 16:09:42, 3] smbd/dosmode.c:unix_mode(111)
  unix_mode(REVIT/test-08-06-07/Martini-central.rvt) returning 0777
[2007/08/06 16:09:42, 2] smbd/open.c:open_file(245)
  johan opened file REVIT/test-08-06-07/Martini-central.rvt read=Yes 
write=No (numopen=3)
[2007/08/06 16:09:42, 3] smbd/process.c:process_smb(1092)
  Transaction 8508 of length 41
[2007/08/06 16:09:42, 3] smbd/process.c:switch_message(887)
  switch message SMBgetattrE (pid 5543) conn 0x949fd30
[2007/08/06 16:09:42, 3] smbd/reply.c:reply_getattrE(5066)
  reply_getattrE fnum=9808
[2007/08/06 16:09:42, 3] smbd/process.c:process_smb(1092)
  Transaction 8509 of length 45
[2007/08/06 16:09:42, 3] smbd/process.c:switch_message(887)
  switch message SMBclose (pid 5543) conn 0x949fd30
[2007/08/06 16:09:42, 3] smbd/reply.c:reply_close(2778)
  close fd=27 fnum=9808 (numopen=3)
[2007/08/06 16:09:42, 2] smbd/close.c:close_normal_file(262)
  johan closed file REVIT/test-08-06-07/Martini-central.rvt (numopen=2)
[2007/08/06 16:09:42, 3] smbd/process.c:process_smb(1092)
  Transaction 8510 of length 83
[2007/08/06 16:09:42, 3] smbd/process.c:switch_message(887)
  switch message SMBunlink (pid 5543) conn 0x949fd30
[2007/08/06 16:09:42, 3] smbd/reply.c:reply_unlink(1697)
  reply_unlink : REVIT/test-08-06-07/Martini-central.rvt
[2007/08/06 16:09:42, 3] smbd/dosmode.c:unix_mode(111)
  unix_mode(REVIT/test-08-06-07/Martini-central.rvt) returning 0777
[2007/08/06 16:09:42, 2] smbd/open.c:open_file(245)
  johan opened file REVIT/test-08-06-07/Martini-central.rvt read=Yes 
write=No (numopen=3)
[2007/08/06 16:09:42, 2] smbd/close.c:close_normal_file(262)
  johan closed file REVIT/test-08-06-07/Martini-central.rvt (numopen=2)

And here's user 'kevin' attempting to get r/w access after johan closed 
everything.

[2007/08/06 16:43:22, 3] smbd/dosmode.c:unix_mode(111)
  unix_mode(REVIT/test-08-06-07/Martini-central.rvt) returning 0777
[2007/08/06 16:43:22, 2] smbd/open.c:open_file(245)
  kevin opened file REVIT/test-08-06-07/Martini-central.rvt read=Yes 
write=No (numopen=1)
[2007/08/06 16:43:22, 3] smbd/process.c:process_smb(1092)
  Transaction 1150 of length 59
[2007/08/06 16:43:22, 3] smbd/process.c:switch_message(887)
  switch message SMBreadX (pid 5566) conn 0x949fd00
[2007/08/06 16:43:22, 3] smbd/reply.c:send_file_readX(2160)
  send_file_readX fnum=9565 max=4096 nread=4096
[2007/08/06 16:43:22, 3] smbd/process.c:process_smb(1092)
  Transaction 1151 of length 41
[2007/08/06 16:43:22, 3] smbd/process.c:switch_message(887)
  switch message SMBgetattrE (pid 5566) conn 0x949fd00
[2007/08/06 16:43:22, 3] smbd/reply.c:reply_getattrE(5066)
  reply_getattrE fnum=9565
[2007/08/06 16:43:22, 3] smbd/process.c:process_smb(1092)
  Transaction 1152 of length 45
[2007/08/06 16:43:22, 3] smbd/process.c:switch_message(887)
  switch message SMBclose (pid 5566) conn 0x949fd00
[2007/08/06 16:43:22, 3] smbd/reply.c:reply_close(2778)
  close fd=25 fnum=9565 (numopen=1)
[2007/08/06 16:43:22, 2] smbd/close.c:close_normal_file(262)
  kevin closed file REVIT/test-08-06-07/Martini-central.rvt (numopen=0)
[2007/08/06 16:43:22, 3] smbd/process.c:process_smb(1092)
  Transaction 1153 of length 110
[2007/08/06 16:43:22, 3] smbd/process.c:switch_message(887)
  switch message SMBopenX (pid 5566) conn 0x949fd00
[2007/08/06 16:43:22, 3] smbd/dosmode.c:unix_mode(111)
  unix_mode(REVIT/test-08-06-07/Martini-central.rvt) returning 0777
[2007/08/06 16:43:22, 2] smbd/open.c:open_file(245)
  kevin opened file REVIT/test-08-06-07/Martini-central.rvt read=Yes 
write=No (numopen=1)
[2007/08/06 16:43:22, 3] smbd/process.c:process_smb(1092)
  Transaction 1154 of length 59

If they put the *central.rvt file on a WinXP workstation, everything 
works fine - so this has to be some sort of filelocking issue.

Per the recent 'Problems with oplocks' thread, I tried 'kernel oplocks = 
no' but it has not made any difference.

Here's my smb.conf; the data share is the one experiencing the problem.

[global]

   netbios name = KAHN
   workgroup = xxx.lan
   server string = new server
   hosts allow = 192.168.141. 127.
   printcap name = /etc/printcap
   load printers = yes
   log file = /var/log/samba/%m.log
   log level = 3 passdb:5 auth:10 winbind:2
   max log size = 0
   security = user
  encrypt passwords = yes
  smb passwd file = /etc/samba/smbpasswd
  unix password sync = Yes
  passwd program = /usr/bin/passwd %u
  passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n 
*passwd:*all*authentication*tokens*updated*successfully*
   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
   local master = yes
   os level = 33
   domain master = yes
   preferred master = yes
   domain logons = yes
 name resolve order = wins lmhosts bcast
   wins support = yes
   dns proxy = no
  default case = lower
force create mode = 0777
force directory mode = 0777
use sendfile = no
max protocol = LANMAN2
kernel oplocks = no

[homes]
   comment = Home Directories
   browseable = no
   writable = yes

[printers]
   comment = All Printers
   path = /var/spool/samba
   browseable = no
   guest ok = no
   printable = yes

[data]
   comment = TND Project files
   path = /home/samba
   public = yes
   writable = yes
   printable = no
   create mask = 0771
   directory mask = 0771
   oplocks = yes


-- 
  o__
  ,>/'_          o__
  (_)\(_)        ,>/'_          o__
Yan Seiner      (_)\(_)         ,>/'_   o__     o__
Certified Personal Trainer     (_)\(_)  ,>/'_   ,>/'_
Licensed Professional Engineer         (_)\(_) (_)\(_)

Linux stuff has made big progress over the competition. When things sit and don't start right away, we have a watch, and those poor guys have to settle for an hourglass.



More information about the samba mailing list