From: Howard Chu Date: Fri, 19 Aug 2011 06:09:17 +0000 (-0700) Subject: Fix multi-page commits X-Git-Tag: OPENLDAP_REL_ENG_2_4_27~148^2~91 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1ceae5c2c011edc5b5997e08270c5edc185fd248;p=openldap Fix multi-page commits --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index c1fc8cf6ee..85535f89e2 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -884,11 +884,12 @@ mdb_txn_commit(MDB_txn *txn) /* Commit up to MDB_COMMIT_PAGES dirty pages to disk until done. */ next = 0; + i = 1; do { n = 0; done = 1; size = 0; - for (i=1; i<=txn->mt_u.dirty_list[0].mid; i++) { + for (; i<=txn->mt_u.dirty_list[0].mid; i++) { dp = txn->mt_u.dirty_list[i].mptr; if (dp->p.mp_pgno != next) { if (n) {