From 10b101d3adcd99d58452f27ffeebbbd11eb7b79e Mon Sep 17 00:00:00 2001 From: Petr Kubat Date: Tue, 31 Oct 2017 16:29:35 +0100 Subject: [PATCH] Fix deadlocks when reading/writing off-page duplicate tree Resolves: #1349779 --- checkpoint-opd-deadlock.patch | 14 ++++++++++++++ libdb.spec | 12 +++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 checkpoint-opd-deadlock.patch diff --git a/checkpoint-opd-deadlock.patch b/checkpoint-opd-deadlock.patch new file mode 100644 index 0000000..7aab6e1 --- /dev/null +++ b/checkpoint-opd-deadlock.patch @@ -0,0 +1,14 @@ +--- db-5.3.21/src/db/db_cam.c.opd_deadlock 2017-10-31 12:20:54.118979690 +0100 ++++ db-5.3.21/src/db/db_cam.c 2017-10-31 12:21:06.828739341 +0100 +@@ -868,6 +868,11 @@ + flags == DB_PREV || flags == DB_PREV_DUP)) { + if (tmp_rmw && (ret = dbc->am_writelock(dbc)) != 0) + goto err; ++ /* Latch the primary tree page here in order to not deadlock later. */ ++ if (cp->page == NULL && ++ (ret = __memp_fget(mpf, &cp->pgno, ++ dbc->thread_info, dbc->txn, 0, &cp->page)) != 0) ++ goto err; + if (F_ISSET(dbc, DBC_TRANSIENT)) + opd = cp->opd; + else if ((ret = __dbc_idup(cp->opd, &opd, DB_POSITION)) != 0) diff --git a/libdb.spec b/libdb.spec index 182c45d..e77c4e3 100644 --- a/libdb.spec +++ b/libdb.spec @@ -4,7 +4,7 @@ Summary: The Berkeley DB database library for C Name: libdb Version: 5.3.28 -Release: 28%{?dist} +Release: 29%{?dist} Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz Source1: http://download.oracle.com/berkeley-db/db.1.85.tar.gz # For mt19937db.c @@ -43,6 +43,8 @@ Patch32: db-5.3.28-rpm-lock-check.patch # downstream patch to hotfix rhbz#1464033, sent upstream Patch33: db-5.3.28-cwd-db_config.patch Patch34: libdb-5.3.21-region-size-check.patch +# Patch sent upstream +Patch35: checkpoint-opd-deadlock.patch URL: http://www.oracle.com/database/berkeley-db/ License: BSD and LGPLv2 and Sleepycat @@ -240,6 +242,7 @@ popd %patch32 -p1 %patch33 -p1 %patch34 -p1 +%patch35 -p1 cd dist ./s_config @@ -451,10 +454,13 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libdb_java.so %changelog -* Tue Oct 24 2017 Petr Kubat 5.3.21-28 +* Tue Oct 31 2017 Petr Kubat 5.3.28-29 +- Fix deadlocks when reading/writing off-page duplicate tree (#1349779) + +* Tue Oct 24 2017 Petr Kubat 5.3.28-28 - Run a number of quick subsystem checks on build -* Thu Sep 07 2017 Petr Kubat 5.3.21-27 +* Thu Sep 07 2017 Petr Kubat 5.3.28-27 - Fail properly when encountering removed or 0-byte regions (#1471011) * Thu Aug 03 2017 Fedora Release Engineering - 5.3.28-26