tdb_lock failed errors (bug #3327)

Tony Mountifield tony at softins.clara.co.uk
Thu Jan 5 20:41:21 GMT 2006


Apologies for following up my own post, but I'm disappointed that despite
people being active on the list, no-one has replied.....

In article <dpgbb3$b6t$1 at softins.clara.co.uk>,
Tony Mountifield <tony at softins.clara.co.uk> wrote:
> I've been investigating the frequent occurrence of the following error
> messages under smbclient 3.0.7 (I think it's common to all 3.0.x):
> 
> [2005/12/14 17:52:53, 5] tdb/tdbutil.c:tdb_log(725) tdb(/var/cache/samba/gencache.tdb):
> tdb_brlock failed (fd=3) at offset 244 rw_type=0 lck_type=14
> [2005/12/14 17:52:53, 5] tdb/tdbutil.c:tdb_log(725) tdb(/var/cache/samba/gencache.tdb):
> tdb_brlock failed (fd=3) at offset 244 rw_type=0 lck_type=14: Bad file descriptor
> [2005/12/14 17:52:53, 0] tdb/tdbutil.c:tdb_log(725) tdb(/var/cache/samba/gencache.tdb):
> tdb_lock failed on list 19 ltype=0 (Bad file descriptor)
> 
> I eventually discovered that it is caused by close_our_files() closing
> the fd for gencache.tdb in the tdb structure (usually fd 3).
> 
> An "lsof" of any mount.smbfs process will show only fds 0, 1 and 2 open,
> even though tdb->fd contains 3.
> 
> What seems to be happening is that gencache.tdb is opened before
> mount.smbfs forks, and the child process assumes it is still open,
> although close_all_files() has stomped on the fd.

I've done some more investigation, and I think this issue could be
corrected in client/smbmount.c by including a call to namecache_shutdown()
within the function send_fs_socket(), just inside the "if (!closed)"
condition. I believe the next time the name cache is required it will
automatically be opened again.

Or should it be done after the cli_shutdown() before the if condition?
Or somewhere else entirely?

Please could anyone who is more familiar with the code then I am comment
on this issue, and whether my suggested solution is the correct way to
try and solve it?

Thanks!
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org


More information about the samba-technical mailing list