From 6d2914c99bf5bd672147f00fc290569b1bb33a8f Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Wed, 25 Nov 2020 17:53:55 +0300 Subject: [PATCH] mdbx: minor/insignificant fix checking `mdbx_rdt_lock()` result for cases mutex-recovery after `EOWNERDEAD`. Change-Id: Ia5e13ea0d72afc97f7d678832a765a192dfacdff --- src/core.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/core.c b/src/core.c index ab2ef829..7400d4eb 100644 --- a/src/core.c +++ b/src/core.c @@ -4803,9 +4803,11 @@ static __cold int mdbx_mapresize(MDBX_env *env, const pgno_t used_pgno, goto bailout; if (limit_bytes != env->me_dxb_mmap.limit && env->me_lck && !implicit) { - rc = mdbx_rdt_lock(env) /* lock readers table until remap done */; - if (unlikely(rc != MDBX_SUCCESS)) + int err = mdbx_rdt_lock(env) /* lock readers table until remap done */; + if (unlikely(MDBX_IS_ERROR(err))) { + rc = err; goto bailout; + } /* looking for readers from this process */ MDBX_lockinfo *const lck = env->me_lck; @@ -9538,9 +9540,11 @@ mdbx_env_set_geometry(MDBX_env *env, intptr_t size_lower, intptr_t size_now, rc = MDBX_EPERM; goto bailout; } - rc = mdbx_rdt_lock(env); - if (unlikely(rc != MDBX_SUCCESS)) + int err = mdbx_rdt_lock(env); + if (unlikely(MDBX_IS_ERROR(err))) { + rc = err; goto bailout; + } /* Check if there are any reading threads that do not use the SRWL */ const size_t CurrentTid = GetCurrentThreadId();