]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/lock.c
tdb2: more tests, hash collision fixes, attribute support.
[ccan] / ccan / tdb2 / lock.c
index 3230b25e383d3b2a3ead9a1ac7ca156b4030f303..c8dbf8267a8f9dab5fc92c9a3e7e810e6d8943d1 100644 (file)
@@ -665,6 +665,8 @@ again:
 
 int tdb_unlock_list(struct tdb_context *tdb, tdb_off_t list, int ltype)
 {
+       list &= ((1ULL << tdb->header.v.hash_bits) - 1);
+
        /* a allrecord lock allows us to avoid per chain locks */
        if (tdb->allrecord_lock.count) {
                if (tdb->allrecord_lock.ltype == F_RDLCK