From 16e64b56e5c3e943032e20458d652933d9ab0f35 Mon Sep 17 00:00:00 2001 From: hvlad Date: Tue, 10 May 2011 09:02:28 +0000 Subject: [PATCH] Backported fix for bug CORE-3465 : Nbackup state lock could be not released after cache error. It results in "Can't lock state for write" bugcheck when backup state is going to be changed. --- src/jrd/cch.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/jrd/cch.cpp b/src/jrd/cch.cpp index 66a1a2e0f63..f5e79d1b2a9 100644 --- a/src/jrd/cch.cpp +++ b/src/jrd/cch.cpp @@ -2426,6 +2426,8 @@ void CCH_unwind(thread_db* tdbb, const bool punt) if (bdb->bdb_flags & BDB_marked) { BUGCHECK(268); // msg 268 buffer marked during cache unwind } + tdbb->getAttachment()->backupStateReadUnLock(tdbb); + bdb->bdb_flags &= ~(BDB_writer | BDB_faked | BDB_must_write); release_bdb(tdbb, bdb, true, false, false); } @@ -2435,6 +2437,8 @@ void CCH_unwind(thread_db* tdbb, const bool punt) SharedLatch* latch = findSharedLatch(tdbb, bdb); while (latch) { + tdbb->getAttachment()->backupStateReadUnLock(tdbb); + release_bdb(tdbb, bdb, true, false, false); latch = findSharedLatch(tdbb, bdb); }