tdb2: use magic freetable value rather than different magic for coalescing
[ccan] / ccan / tdb2 / check.c
index dc18e64acc55e8d078a258a986200cd6e9daa89d..0766f9e9702122f011c5d4930072bd43e315ee3d 100644 (file)
@@ -497,8 +497,7 @@ static bool check_linear(struct tdb_context *tdb,
                        }
                        found_recovery = true;
                        len = sizeof(rec.r) + rec.r.max_len;
                        }
                        found_recovery = true;
                        len = sizeof(rec.r) + rec.r.max_len;
-               } else if (frec_magic(&rec.f) == TDB_FREE_MAGIC
-                          || frec_magic(&rec.f) == TDB_COALESCING_MAGIC) {
+               } else if (frec_magic(&rec.f) == TDB_FREE_MAGIC) {
                        len = sizeof(rec.u) + frec_len(&rec.f);
                        if (off + len > tdb->map_size) {
                                tdb_logerr(tdb, TDB_ERR_CORRUPT,
                        len = sizeof(rec.u) + frec_len(&rec.f);
                        if (off + len > tdb->map_size) {
                                tdb_logerr(tdb, TDB_ERR_CORRUPT,
@@ -508,8 +507,8 @@ static bool check_linear(struct tdb_context *tdb,
                                           (long long)len, (long long)off);
                                return false;
                        }
                                           (long long)len, (long long)off);
                                return false;
                        }
-                       /* This record is free! */
-                       if (frec_magic(&rec.f) == TDB_FREE_MAGIC
+                       /* This record should be in free lists. */
+                       if (frec_flist(&rec.f) != TDB_FLIST_NONE
                            && !append(free, num_free, off))
                                return false;
                } else {
                            && !append(free, num_free, off))
                                return false;
                } else {