From 10f84ad9e1cb939878f6c1ec7e73c30dd133a0f2 Mon Sep 17 00:00:00 2001 From: Jeroen Ruigrok/asmodai Date: Sun, 19 Sep 2004 18:08:21 +0000 Subject: [PATCH] From NetBSD 1.11: Fix a condition where the hole would be inserted in the wrong place during a split. Inspired by FreeBSD commit, which did the same. Submitted by: Simon 'corecode' Schubert. --- lib/libc/db/btree/bt_split.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/db/btree/bt_split.c b/lib/libc/db/btree/bt_split.c index cb608b0137..6610482aab 100644 --- a/lib/libc/db/btree/bt_split.c +++ b/lib/libc/db/btree/bt_split.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)bt_split.c 8.9 (Berkeley) 7/26/94 - * $DragonFly: src/lib/libc/db/btree/bt_split.c,v 1.4 2003/11/12 20:21:22 eirikn Exp $ + * $DragonFly: src/lib/libc/db/btree/bt_split.c,v 1.5 2004/09/19 18:08:21 asmodai Exp $ */ #include @@ -726,7 +726,7 @@ bt_psplit(t, h, l, r, pskip, ilen) * the right page. */ if (skip <= off) { - skip = 0; + skip = MAX_PAGE_OFFSET; rval = l; } else { rval = r; @@ -736,7 +736,7 @@ bt_psplit(t, h, l, r, pskip, ilen) for (off = 0; nxt < top; ++off) { if (skip == nxt) { ++off; - skip = 0; + skip = MAX_PAGE_OFFSET; } switch (h->flags & P_TYPE) { case P_BINTERNAL: -- 2.41.0