Skip to content
Snippets Groups Projects
Commit 70512edd authored by Howard Chu's avatar Howard Chu
Browse files

ITS#4572 don't unlock non-existent locks

parent 9b7dc0aa
No related branches found
No related tags found
No related merge requests found
......@@ -146,7 +146,7 @@ bdb_cache_entry_db_unlock ( DB_ENV *env, DB_LOCK *lock )
#else
int rc;
if ( !lock ) return 0;
if ( !lock || lock->mode == DB_LOCK_NG ) return 0;
rc = LOCK_PUT ( env, lock );
return rc;
......
......@@ -56,8 +56,11 @@ bdb_dn2entry(
rc2 = bdb_cache_find_id( op, tid, ei->bei_id,
&ei, 1, locker, lock );
if ( rc2 ) rc = rc2;
} else if ( ei )
} else if ( ei ) {
bdb_cache_entryinfo_unlock( ei );
memset( lock, 0, sizeof( *lock ));
lock->mode = DB_LOCK_NG;
}
} else if ( ei ) {
bdb_cache_entryinfo_unlock( ei );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment