]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/free.c
tdb2: careful on wrap.
[ccan] / ccan / tdb2 / free.c
index 1b2c552a66fecea4a5e3190a4b4d3e1f5fe51cc3..03ca5a4f9471c17920bb9b1d44b7953e2f560eea 100644 (file)
@@ -898,7 +898,7 @@ static enum TDB_ERROR tdb_expand(struct tdb_context *tdb, tdb_len_t size)
 
        /* Someone else may have expanded the file, so retry. */
        old_size = tdb->file->map_size;
-       tdb->tdb2.io->oob(tdb, tdb->file->map_size + 1, true);
+       tdb->tdb2.io->oob(tdb, tdb->file->map_size, 1, true);
        if (tdb->file->map_size != old_size) {
                tdb_unlock_expand(tdb, F_WRLCK);
                return TDB_SUCCESS;