From e2f37908b953ee98c6d2d7e63e76297ee7b124df Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sat, 6 Jul 2019 21:23:26 +0300 Subject: [PATCH] mdbx: fix/refine error handling while DB-pages walking. Change-Id: If910e96cc7c30577531aab24b5a9573e5fe9126d --- src/mdbx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mdbx.c b/src/mdbx.c index ec00390f..d442abb6 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -13013,7 +13013,7 @@ static int __cold mdbx_env_walk(mdbx_walk_ctx_t *ctx, const char *dbi, payload_size, header_size, unused_size + align_bytes); if (unlikely(rc != MDBX_SUCCESS)) - return (rc == MDBX_RESULT_TRUE) ? MDBX_SUCCESS : MDBX_SUCCESS; + return (rc == MDBX_RESULT_TRUE) ? MDBX_SUCCESS : rc; for (int i = 0; i < nkeys; i++) { if (type == MDBX_page_dupfixed_leaf) @@ -13022,6 +13022,11 @@ static int __cold mdbx_env_walk(mdbx_walk_ctx_t *ctx, const char *dbi, MDBX_node *node = NODEPTR(mp, i); if (type == MDBX_page_branch) { rc = mdbx_env_walk(ctx, dbi, NODEPGNO(node), deep + 1); + if (unlikely(rc != MDBX_SUCCESS)) { + if (rc != MDBX_RESULT_TRUE) + return rc; + break; + } continue; }