]> git.sur5r.net Git - openldap/commitdiff
Make sure 2 subpages fit in one real page
authorHoward Chu <highlandsun@gmail.com>
Mon, 19 Sep 2011 01:13:23 +0000 (18:13 -0700)
committerHoward Chu <highlandsun@gmail.com>
Mon, 19 Sep 2011 01:13:23 +0000 (18:13 -0700)
libraries/libmdb/mdb.c

index 6f279e3cb864a28d9157d4e9905227f6a07e26a4..117a8913399c26258ba270c6fecbf8263c858831 100644 (file)
@@ -3695,7 +3695,8 @@ top:
                                        offset = NODESIZE + sizeof(indx_t) + data->mv_size;
                                }
                                offset += offset & 1;
-                               if (NODEDSZ(leaf) + offset >= mc->mc_txn->mt_env->me_psize / MDB_MINKEYS) {
+                               if (NODESIZE + NODEKSZ(leaf) + NODEDSZ(leaf) + offset >=
+                                       (mc->mc_txn->mt_env->me_psize - PAGEHDRSZ) / MDB_MINKEYS) {
                                        /* yes, convert it */
                                        dummy.md_flags = 0;
                                        if (mc->mc_db->md_flags & MDB_DUPFIXED) {