tdb lockkeys/unlockkeys

Jeremy Allison jra at samba.org
Fri Oct 15 00:01:24 GMT 2004


On Sat, Oct 09, 2004 at 11:04:54PM -0700, Taj Khattra wrote:
> hi,
> 
> samba-3.0.6 (but i think the bug is present in all versions of tdb)
> 
> in tdb_lockeys(), i think
>         tdb_lock(tdb, i, F_WRLCK)
> should instead be
>         tdb_lock(tdb, BUCKET(tdb->lockedkeys[i+1]), F_WRLCK)
> and
>         tdb_unlock(tdb, j, F_WRLCK)
> should instead be
>         tdb_unlock(tdb, BUCKET(tdb->lockedkeys[j+1]), F_WRLCK)
> 
> similary, in tdb_unlockkeys, i think
>         tdb_unlock(tdb, tdb->lockedkeys[i+1], F_WRLCK)
> should instead be
>         tdb_unlock(tdb, BUCKET(tdb->lockedkeys[i+1]), F_WRLCK)
> 
> ??

Yes, indeed this looks completely correct. Thanks a lot for spotting
this, I'll add it to all current code trees.

Jeremy.


More information about the samba-technical mailing list