ITS#4572 don't unlock non-existent locks

This commit is contained in:
Howard Chu 2006-06-01 02:03:10 +00:00
parent 9b7dc0aa36
commit 70512edd5a
2 changed files with 5 additions and 2 deletions

View file

@ -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;

View file

@ -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 );
}