From 03cc19babb2f898ef54ad07d339cf2324baf09b2 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Mon, 8 Jun 2020 14:56:41 +0300 Subject: [PATCH] mdbx: preserve error from env_set_geometry() inside setup_dxb(). Change-Id: I8dae0b38eb09cfaa07cdd80cb37dc414e2f99d7a --- src/core.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core.c b/src/core.c index 8054a98b..eb7da7e5 100644 --- a/src/core.c +++ b/src/core.c @@ -9310,8 +9310,9 @@ static int __cold mdbx_setup_dxb(MDBX_env *env, const int lck_rc) { meta.mm_geo.upper * pagesize, meta.mm_geo.grow * pagesize, meta.mm_geo.shrink * pagesize, meta.mm_psize); if (unlikely(err != MDBX_SUCCESS)) { - mdbx_error("%s", "could not use present dbsize-params from db"); - return MDBX_INCOMPATIBLE; + mdbx_error("%s: err %d", "could not apply preconfigured db-geometry", + err); + return (err == MDBX_EINVAL) ? MDBX_INCOMPATIBLE : err; } } else if (env->me_dbgeo.now) { /* silently growth to last used page */ @@ -9342,8 +9343,9 @@ static int __cold mdbx_setup_dxb(MDBX_env *env, const int lck_rc) { env->me_dbgeo.upper, env->me_dbgeo.grow, env->me_dbgeo.shrink, meta.mm_psize); if (unlikely(err != MDBX_SUCCESS)) { - mdbx_error("%s", "could not apply preconfigured dbsize-params to db"); - return MDBX_INCOMPATIBLE; + mdbx_error("%s: err %d", "could not apply preconfigured db-geometry", + err); + return (err == MDBX_EINVAL) ? MDBX_INCOMPATIBLE : err; } /* update meta fields */