From: Howard Chu Date: Mon, 23 Nov 2015 13:11:29 +0000 (+0000) Subject: ITS#8323 Fix nested commit X-Git-Tag: accepted/tizen/5.0/unified/20181102.030725~139 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=83258ca81efbfdbccc2b09c4539b9babe5c27726;p=platform%2Fupstream%2Flmdb.git ITS#8323 Fix nested commit Must remove our spilled pages from parent's dirty list --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 6c4a4da..fe78eb9 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -3500,6 +3500,25 @@ mdb_txn_commit(MDB_txn *txn) pspill[0] = y; } + /* Remove anything in our spill list from parent's dirty list */ + if (txn->mt_spill_pgs && txn->mt_spill_pgs[0]) { + for (i=1; i<=txn->mt_spill_pgs[0]; i++) { + MDB_ID pn = txn->mt_spill_pgs[i]; + if (pn & 1) + continue; /* deleted spillpg */ + pn >>= 1; + y = mdb_mid2l_search(dst, pn); + if (y <= dst[0].mid && dst[y].mid == pn) { + free(dst[y].mptr); + while (y < dst[0].mid) { + dst[y] = dst[y+1]; + y++; + } + dst[0].mid--; + } + } + } + /* Find len = length of merging our dirty list with parent's */ x = dst[0].mid; dst[0].mid = 0; /* simplify loops */