]> git.ozlabs.org Git - ccan/commitdiff
tdb2: don't use probe arg to oob()
authorRusty Russell <rusty@rustcorp.com.au>
Sat, 25 Sep 2010 04:27:51 +0000 (13:57 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Sat, 25 Sep 2010 04:27:51 +0000 (13:57 +0930)
We want it to complain if it's wrong...

ccan/tdb2/check.c

index 1ce75be065f4317b1e63a4c2bc1afb47e446478b..cb864ab74ff5a34707199ef374bdc67fede666e9 100644 (file)
@@ -287,8 +287,8 @@ static bool check_free(struct tdb_context *tdb,
                return false;
        }
        if (tdb->methods->oob(tdb, off
                return false;
        }
        if (tdb->methods->oob(tdb, off
-                             + frec->data_len-sizeof(struct tdb_used_record),
-                             true))
+                             + frec->data_len+sizeof(struct tdb_used_record),
+                             false))
                return false;
        if (off < zone_off || off >= zone_off + (1ULL<<frec_zone_bits(frec))) {
                tdb->log(tdb, TDB_DEBUG_ERROR, tdb->log_priv,
                return false;
        if (off < zone_off || off >= zone_off + (1ULL<<frec_zone_bits(frec))) {
                tdb->log(tdb, TDB_DEBUG_ERROR, tdb->log_priv,
@@ -487,7 +487,6 @@ int tdb_check(struct tdb_context *tdb,
        unsigned max_zone_bits = INITIAL_ZONE_BITS;
        uint8_t tailer;
 
        unsigned max_zone_bits = INITIAL_ZONE_BITS;
        uint8_t tailer;
 
-       /* This always ensures the header is uptodate. */
        if (tdb_allrecord_lock(tdb, F_RDLCK, TDB_LOCK_WAIT, false) != 0)
                return -1;
 
        if (tdb_allrecord_lock(tdb, F_RDLCK, TDB_LOCK_WAIT, false) != 0)
                return -1;