changes to .tdb files lost

Pierre Filippone pierre.filippone at retail-sc.com
Fri Sep 9 10:17:53 GMT 2005


"Gerald (Jerry) Carter" <jerry at samba.org> wrote on 08.09.2005 17:50:34:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Pierre Filippone wrote:
> 
> | So I switched off the disk controller's write cache,
> | turned off journaling  (ext3->ext2), made the
> | changes again and checked the results with "tdbdump
> | account_policy.tdb", "pdbedit" and "net rpc rights
> | list". All changes  (seemed to be) in there. Then I
> | stopped samba ( kill -15 ) and rebooted again.
> | Changes lost again.
> 
> Is a reboot required?  Or are the changes lost
> on a smbd restart?

Yes, reboot is required. After a smbd restart alone the changes are still 
there.

> 
> What platform is this?  COUld you retest with 'use mmap = no'
> as well?

We use SLES 9 SP 2. 'mmap = no' solves it. 

Meanwhile I found this in the msync man page:

       msync  flushes  changes made to the in-core copy of a file
       that was mapped into memory using mmap(2)  back  to  disk.
       Without  use  of  this  call  there  is  no guarantee that
       changes are written back before munmap(2) is  called.

I tried an "msync(tdb->map_ptr, tdb->map_size, MS_SYNC);" right before the 
munmap() in tdb/tdb.c and it fixes the problem. Changes are still there 
after reboot.

The only thing that is strange, is that the mtime of account_policy.tdb 
still does not change.

Maybe my first bug fix ? ;-) 

Regards,

Pierre


More information about the samba-technical mailing list