tdb_check fails with tdb read-only open.

Jeremy Allison jra at samba.org
Mon Sep 13 11:45:30 MDT 2010


On Mon, Sep 13, 2010 at 05:20:50PM +0930, Rusty Russell wrote:
> On Thu, 29 Jul 2010 07:35:13 am tridge at samba.org wrote:
> > looks good to me - nice and simple :-)
> 
> And unfortunately, doesn't work.
> 
> I just got around to porting this to CCAN, and added a unit test for it.
> 
> tdb_lockall_read() fails on r/o TDBs.  So that needs to be fixed too.  You

How does this fail ? As far as I can see it
only does F_RDLCK calls on the db - shouldn't
that always succeed against a r/o fd ? Just trying
to understand the error.

Ahhhh. Wait a minute - you mean in the tdb_lock_and_recover()
call inside tdb_allrecord_lock() if tdb_needs_recovery()
returns true ? That call always uses F_WRLCK calls.
Shouldn't we just fail this call against a r/o db ?

> can still get a spurious tdb_check() fail, since we turn off *all* locking
> on r/o TDBs.  But you can get other corruption if someone's modifying it too,
> so this is probably OK.
> 
> Patch coming...

Doesn't your patch still leave the F_WRLCK code
inside tdb_lock_and_recover() ?

Thanks,

Jeremy.


More information about the samba-technical mailing list