Bug 1241 - corrupted locking.tdb
corrupted locking.tdb
Status: CLOSED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: File Services
3.0.2a
All FreeBSD
: P3 major
: none
Assigned To: Samba Bugzilla Account
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-05 05:02 UTC by Alex Deiter
Modified: 2005-08-24 10:17 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Deiter 2004-04-05 05:02:40 UTC
Periodically corrupted file locking.tdb.

Client #1 (windows 2000 sp4) open ~700 files on samba share:
....
44578  DENY_NONE  0x2019f     RDWR       EXCLUSIVE+BATCH 
/home/samba/1c/_1C-UCHTA1/DH30029
.DBF   Mon Apr  5 15:08:15 2004
44578  DENY_NONE  0x2019f     RDWR       EXCLUSIVE+BATCH 
/home/samba/1c/_1C-UCHTA1/DH24326
.CDX   Mon Apr  5 15:08:15 2004
44578  DENY_NONE  0x2019f     RDWR       EXCLUSIVE+BATCH 
/home/samba/1c/_1C-UCHTA1/DH6478.
CDX   Mon Apr  5 15:08:13 2004
44578  DENY_NONE  0x2019f     RDWR       EXCLUSIVE+BATCH 
/home/samba/1c/_1C-UCHTA1/DT6191.
DBF   Mon Apr  5 15:08:12 2004
44578  DENY_NONE  0x2019f     RDWR       EXCLUSIVE+BATCH 
/home/samba/1c/_1C-UCHTA1/DH25817
.DBF   Mon Apr  5 15:08:15 2004
44578  DENY_NONE  0x2019f     RDWR       EXCLUSIVE+BATCH 
/home/samba/1c/_1C-UCHTA1/DH23833
....

Client #2 (windows 2000 sp4) opens the same ~700 files, then smbstatus reports:
...
44585  DENY_NONE  0x2019f     RDWR       EXCLUSIVE+BATCH  "╝   Mon Apr  5
15:08:49 2004
44585  DENY_NONE  0x2019f     RDWR       EXCLUSIVE+BATCH  "╝   Mon Apr  5
15:08:48 2004
44585  DENY_NONE  0x2019f     RDWR       EXCLUSIVE+BATCH  "╝   Mon Apr  5
15:08:48 2004
44585  DENY_NONE  0x2019f     RDWR       EXCLUSIVE+BATCH  "╝   Mon Apr  5
15:08:48 2004
44585  DENY_NONE  0x2019f     RDWR       EXCLUSIVE+BATCH  "╝   Mon Apr  5
15:08:48 2004
44585  DENY_NONE  0x2019f     RDWR       EXCLUSIVE+BATCH  "╝   Mon Apr  5
15:08:47 2004
44585  DENY_NONE  0x2019f     RDWR       EXCLUSIVE+BATCH  "╝   Mon Apr  5
15:08:48 2004
44585  DENY_NONE  0x2019f     RDWR       EXCLUSIVE+BATCH  "╝   Mon Apr  5
15:08:47 2004
...

And both clients receive a error of blocking of a file.

After update samba up to 3.0.3pre1 i see a error on samba server:

tdb(/var/db/samba/locking.tdb): rec_read bad magic 0xd9fee666 at offset=77560
tdb_log: TDB /var/db/samba/locking.tdb is corrupt. Removing file and stopping
this process.
PANIC: corrupt tdb
Comment 1 Daniel Jarboe 2004-04-15 10:04:14 UTC
May or may not be related: A print-server here runs OK with 3.0.2a (and post-
3.0.2a printing patches), but for 3.0.3pre1 and 3.0.3pre2 has severe tdb 
corruption problems (connections.tdb, sessionid.tdb, and individual printer 
tdbs).  I may be special case though, because tdb's have been touchy here (we 
require use mmap = no).  3.0.2a is fine, 3.0.3pre1 and pre2 are not.

http://pserver.samba.org/cgi-bin/cvsweb/samba/source/tdb/tdb.c.diff?
r1=1.106.2.18&r2=1.106.2.19&f=h seems the most likely candidate, but I have 
been unable to track it down.  And again, my problem might be specific to this 
platform, and unrelated to your problem.
Comment 2 Gerald (Jerry) Carter 2004-07-21 12:35:32 UTC
This should be fixed in the current 3.0 svn tree.
There was a bug where a few tdb's were being opened
without honoring the 'use mmap = no' option.
Comment 3 Gerald (Jerry) Carter 2005-08-24 10:17:09 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.