[Samba] File locking in NFS on Solaris

William Jojo jojowil at hvcc.edu
Thu Sep 16 18:15:38 GMT 2004



Hmmmm. I've been following an smbpasswd locking problem over NFS (on AIX
5.2 ML04 - Samba 3.0.7) that appears to be F_SETLKW64 related as well when
I'm trying to join a machine to a domain or when a workstations tries to
actively change it's trust after 7 days. It's intermittent and doesn't
appear related to load...the smbpasswd file attemps a lock and fails after
caught alarm (5 seconds) just like the pdb_smbpasswd.c code shows.

for example:

What I did notice is that's the only call in my truss that had that value
during pw_file_lock() all my other kfcntl calls were using F_SETLKW.

I've thought about recompiling the whole distro using -q64 on the compiler
to see if it makes a difference.

I've also seen:

kfcntl(0, F_DUPFD, 0x00000000)  (sleeping...)

now one thing i've noticed is that I get a *LOT* of left over IPC$
connections from workstations that aren't doing anything except sitting at
the login screen of XP (and probably trying to change their password :-)

(sample smbstatus -S)

IPC$         371196   h253466       Thu Sep 16 12:51:03 2004
IPC$         371196   h253466       Thu Sep 16 12:51:06 2004
IPC$         414426   h253466       Thu Sep 16 12:52:33 2004
IPC$         414426   h253466       Thu Sep 16 12:52:37 2004
IPC$         375182   h253466       Thu Sep 16 13:06:03 2004
IPC$         375182   h253466       Thu Sep 16 13:06:05 2004
IPC$         345158   h253466       Thu Sep 16 13:07:50 2004
IPC$         345158   h253466       Thu Sep 16 13:07:53 2004
IPC$         431008   h253466       Thu Sep 16 13:21:03 2004
IPC$         431008   h253466       Thu Sep 16 13:21:05 2004
IPC$         358448   h253466       Thu Sep 16 13:22:35 2004
IPC$         358448   h253466       Thu Sep 16 13:22:38 2004
IPC$         357180   h253466       Thu Sep 16 13:36:03 2004
IPC$         357180   h253466       Thu Sep 16 13:36:06 2004
IPC$         355198   h253466       Thu Sep 16 13:37:21 2004
IPC$         355198   h253466       Thu Sep 16 13:37:23 2004
IPC$         400586   h253466       Thu Sep 16 13:51:02 2004
IPC$         400586   h253466       Thu Sep 16 13:51:05 2004
IPC$         420788   h253466       Thu Sep 16 13:52:40 2004
IPC$         420788   h253466       Thu Sep 16 13:52:44 2004
IPC$         379934   h253486       Thu Sep 16 13:01:58 2004
IPC$         379934   h253486       Thu Sep 16 13:02:01 2004
IPC$         382558   h253486       Thu Sep 16 13:03:54 2004
IPC$         382558   h253486       Thu Sep 16 13:03:57 2004
IPC$         234724   h253607       Thu Sep 16 12:49:48 2004
IPC$         234724   h253607       Thu Sep 16 12:49:56 2004
IPC$         346164   h253607       Thu Sep 16 13:03:53 2004
IPC$         346164   h253607       Thu Sep 16 13:03:56 2004
IPC$         395482   h253607       Thu Sep 16 13:06:00 2004
IPC$         395482   h253607       Thu Sep 16 13:06:03 2004
IPC$         366154   h253607       Thu Sep 16 13:18:53 2004
IPC$         366154   h253607       Thu Sep 16 13:18:56 2004
IPC$         384448   h253607       Thu Sep 16 13:20:46 2004

which I did a kill -1 on and the (*BELOW*) snippet from log.smbd and truss
is what occured....can't figure out why there's a F_DUPFD before trying to
lock smbpasswd....very strange...

regardless, excluding the intermittent F_DUPFD, I get the strange locking
error mucho frequently. always centered around the F_SETLKW64....

what's really interesting to take notice of is the fact that the alarm
didn't go off until I interrupted the process....




[2004/09/15 12:58:36, 0] lib/util_file.c:do_file_lock(67)
  do_file_lock: failed to lock file.
[2004/09/15 12:58:36, 0] passdb/pdb_smbpasswd.c:mod_smbfilepwd_entry(712)
  mod_smbfilepwd_entry: unable to lock file /samba/3.0.7/private/smbpasswd
[2004/09/15 12:58:36, 0]
passdb/pdb_smbpasswd.c:smbpasswd_update_sam_account(143
6)
[2004/09/15 12:58:36, 0] lib/util_file.c:do_file_lock(67)
  smbpasswd_update_sam_account: mod_smbfilepwd_entry failed!
  do_file_lock: failed to lock file.
[2004/09/15 12:58:36, 0] passdb/pdb_smbpasswd.c:mod_smbfilepwd_entry(712)
  mod_smbfilepwd_entry: unable to lock file /samba/3.0.7/private/smbpasswd
[2004/09/15 12:58:36, 0]
passdb/pdb_smbpasswd.c:smbpasswd_update_sam_account(143
6)
  smbpasswd_update_sam_account: mod_smbfilepwd_entry failed!
[2004/09/15 12:58:36, 0] lib/util_file.c:do_file_lock(67)
  do_file_lock: failed to lock file.
[2004/09/15 12:58:36, 0] passdb/pdb_smbpasswd.c:mod_smbfilepwd_entry(712)
  mod_smbfilepwd_entry: unable to lock file /samba/3.0.7/private/smbpasswd
[2004/09/15 12:58:36, 0]
passdb/pdb_smbpasswd.c:smbpasswd_update_sam_account(143
6)
  smbpasswd_update_sam_account: mod_smbfilepwd_entry failed!




kfcntl(0, F_DUPFD, 0x00000000)  (sleeping...)
kfcntl(0, F_DUPFD, 0x00000000)                  Err#82 ERESTART
    Received signal #1, SIGHUP [caught]
    Received signal #14, SIGALRM [caught]
    Received signal #19, SIGCONT [default]
ksetcontext_sigreturn(0x2FF1FF40, 0x00000000, 0x2FF1FF40, 0x2FF3B000,
0x10025210, 0x0000D0B2, 0xA0277000, 0x2FF39F28)
kwrite(24, "01", 1)                             =3D 1
ksetcontext_sigreturn(0x2FF20340, 0x00000000, 0x2014CE1C, 0x0000D0B2,
0x00000000, 0x00000000, 0x00000000, 0xBD02C058)
kfcntl(25, 13, 0x2FF207C0)      (sleeping...)
kfcntl(25, 13, 0x2FF207C0)                      =3D 0
incinterval(0, 0x2FF20748, 0x2FF20758)          =3D 0
sigprocmask(2, 0xF0243738, 0x2FF206F0)          =3D 0
_sigaction(14, 0x2FF20750, 0x2FF20760)          =3D 0
thread_setmymask_fast(0x40001080, 0x00000000, 0x00000000, 0x10435083,
0x00000000, 0x00000000, 0x00000000, 0xBD02C058) =3D 0x00000000
getuidx(1)                                      =3D 0
fstatx(26, 0x2FF20150, 128, 010)                =3D 0
kwrite(26, " [ 2 0 0 4 / 0 9 / 1 5  ".., 58)    =3D 58
getuidx(1)                                      =3D 0
kwrite(26, "     d o _ f i l e _ l o".., 37)    =3D 37
getuidx(1)                                      =3D 0
kwrite(26, " [ 2 0 0 4 / 0 9 / 1 5  ".., 74)    =3D 74
getuidx(1)                                      =3D 0
kwrite(26, "     m o d _ s m b f i l".., 75)    =3D 75
close(25)                                       =3D 0
getuidx(1)                                      =3D 0
kwrite(26, " [ 2 0 0 4 / 0 9 / 1 5  ".., 83)    =3D 83
getuidx(1)                                      =3D 0
kwrite(26, "     s m b p a s s w d _".., 61)    =3D 61


(i don't have a gdb for AIX, so....)


I doubt this helps, but you never know....


Bill


On Thu, 16 Sep 2004, Andreas Haupt wrote:

> Hello,
>
> System: Solaris 8/9
> Samba: 3.02 and 3.06
>
> We have problems with accessing files (from Windows XP) on a samba server
> that are mounted over nfs (on the server). Some users have symlinks in
> their home directories to nfs resources. When they try to copy file
> located in nfs the client simply hangs. To make the thing even stranger:
> Sometimes it also works (after restarting the samba server from time to
> time)! Files mounted on a Solaris nfs server seem to be more affected
> than files served by Linux.
>
> On the server I can see the hanging smbd processes. truss -p tells me tha=
t
> those processes are waiting for a file lock:
>
> fcntl(11, F_SETLKW64, 0xFFBEEF38)
>
> Here are some messages from the samba log (seems to be related with
> Windows recognizing the hanging connection and starting a new one).
>
> [2004/09/16 10:04:15, 1] smbd/service.c:make_connection_snum(705)
>   diapp2 (134.30.6.13) connect to service dbi initially as user dbi
> (uid=3D1250, gid=3D11211) (pid 29469)
> [2004/09/16 10:04:47, 0] smbd/oplock.c:request_oplock_break(1023)
>   request_oplock_break: no response received to oplock break request to
> pid 294 65 on port 39192 for dev =3D 3f42873, inode =3D 1171213, file_id =
=3D
> 218
> [2004/09/16 10:04:47, 0] smbd/open.c:open_mode_check(681)
>   open_mode_check: exlusive oplock left by process 29465 after break ! Fo=
r
> file wwwhome/aktuell/aktuell_test.html, dev =3D 3f42873, inode =3D 117121=
3.
> Deleting it to continue...
> [2004/09/16 10:04:47, 0] smbd/open.c:open_mode_check(685)
>   open_mode_check: Existent process 29465 left active oplock.
>
> Here are the relevant (I think) entries from smb.conf:
>
>         locking =3D yes
>         lock dir =3D /var/spool/locks/samba
>         kernel oplocks =3D no
>         oplocks =3D yes
>         level2 oplocks =3D yes
>         veto oplock files =3D /*.mdb/
>         posix locking =3D yes
>
> Can you please help me to solve this?
>
> Greetings
> Andreas
>
> --
> | Andreas Haupt                    | E-Mail:  andreas.haupt at hmi.de
> | Hahn-Meitner-Institut (DN)       | WWW:
> | Glienicker Stra=DFe 100            | Phone:   +49/30/8062-2597
> | 14109 Berlin                     | Fax:     +49/30/8062-2096
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  http://lists.samba.org/mailman/listinfo/samba
>
>


More information about the samba mailing list