mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
ITS#7377 Catch MDB failure updating root pointers.
"cannot fail" was wrong, it fails at least when exceeding mapsize.
This commit is contained in:
parent
c7db955a94
commit
d90581fa5a
@ -2124,9 +2124,7 @@ mdb_txn_commit(MDB_txn *txn)
|
|||||||
DPRINTF("committing txn %zu %p on mdbenv %p, root page %zu",
|
DPRINTF("committing txn %zu %p on mdbenv %p, root page %zu",
|
||||||
txn->mt_txnid, (void *)txn, (void *)env, txn->mt_dbs[MAIN_DBI].md_root);
|
txn->mt_txnid, (void *)txn, (void *)env, txn->mt_dbs[MAIN_DBI].md_root);
|
||||||
|
|
||||||
/* Update DB root pointers. Their pages have already been
|
/* Update DB root pointers */
|
||||||
* touched so this is all in-place and cannot fail.
|
|
||||||
*/
|
|
||||||
if (txn->mt_numdbs > 2) {
|
if (txn->mt_numdbs > 2) {
|
||||||
MDB_dbi i;
|
MDB_dbi i;
|
||||||
MDB_val data;
|
MDB_val data;
|
||||||
@ -2136,7 +2134,9 @@ mdb_txn_commit(MDB_txn *txn)
|
|||||||
for (i = 2; i < txn->mt_numdbs; i++) {
|
for (i = 2; i < txn->mt_numdbs; i++) {
|
||||||
if (txn->mt_dbflags[i] & DB_DIRTY) {
|
if (txn->mt_dbflags[i] & DB_DIRTY) {
|
||||||
data.mv_data = &txn->mt_dbs[i];
|
data.mv_data = &txn->mt_dbs[i];
|
||||||
mdb_cursor_put(&mc, &txn->mt_dbxs[i].md_name, &data, 0);
|
rc = mdb_cursor_put(&mc, &txn->mt_dbxs[i].md_name, &data, 0);
|
||||||
|
if (rc)
|
||||||
|
goto fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user