From 5bbff34ac11d1eb2dcd7eff5f197d2140bd5e816 Mon Sep 17 00:00:00 2001 From: hvlad Date: Thu, 5 May 2011 17:40:54 +0000 Subject: [PATCH] FiFixed 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 a59efc730c..5d7eaff69c 100644 --- a/src/jrd/cch.cpp +++ b/src/jrd/cch.cpp @@ -2235,6 +2235,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); } @@ -2244,6 +2246,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); }