Hacky patch that mlock()s rpmdb's environment mmap(2)s, in order to
attempt to avoid spurious rpmdb corruption issues on Linux that seem
to be somehow related to pagein/pageout occuring.
Signed-off-by: Lennert Buytenhek <buytenh(a)marvell.com>
Signed-off-by: Kedar Sovani <kedars(a)marvell.com>
---
rpm-4.6.0-always-mlock.diff | 11 +++++++++++
rpm.spec | 8 ++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
create mode 100644 rpm-4.6.0-always-mlock.diff
diff --git a/rpm-4.6.0-always-mlock.diff b/rpm-4.6.0-always-mlock.diff
new file mode 100644
index 0000000..6af1b78
--- /dev/null
+++ b/rpm-4.6.0-always-mlock.diff
@@ -0,0 +1,11 @@
+diff -urp rpm-4.6.0-rc1.orig/lib/backend/db3.c rpm-4.6.0-rc1/lib/backend/db3.c
+--- rpm-4.6.0-rc1.orig/lib/backend/db3.c 2008-10-10 01:42:14.000000000 -0400
++++ rpm-4.6.0-rc1/lib/backend/db3.c 2008-11-20 22:19:55.000000000 -0500
+@@ -368,6 +368,7 @@ static int db_init(dbiIndex dbi, const c
+ }
+ }
+
++ eflags |= DB_LOCKDOWN;
+ rc = (dbenv->open)(dbenv, dbhome, eflags, dbi->dbi_perms);
+ rc = cvtdberr(dbi, "dbenv->open", rc, _debug);
+ if (rc)
diff --git a/rpm.spec b/rpm.spec
index b65281a..eef2967 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -18,7 +18,7 @@
Summary: The RPM package management system
Name: rpm
Version: %{rpmver}
-Release: 0.%{snapver}.7
+Release: 0.%{snapver}.7.fa1
Group: System Environment/Base
Url:
http://www.rpm.org/
Source0:
http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
@@ -42,6 +42,7 @@ Patch205: rpm-4.6.0-rc1-file-debuginfo.patch
# These are not yet upstream
Patch300: rpm-4.5.90-posttrans.patch
+Patch400: rpm-4.6.0-always-mlock.diff
# Partially GPL/LGPL dual-licensed and some bits with BSD
# SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD
@@ -178,7 +179,7 @@ that will manipulate RPM packages and databases.
%patch203 -p1 -b .defaultdocdir
%patch204 -p1 -b .fp-hash
%patch205 -p1 -b .file-debuginfo
-
+%patch400 -p1 -b .always-mlock
# needs a bit of upstream love first...
#%patch300 -p1 -b .posttrans
@@ -368,6 +369,9 @@ exit 0
%doc doc/librpm/html/*
%changelog
+* Tue Dec 9 2008 Kedar Sovani <kedars(a)marvell.com
+- always lock the rpm database
+
* Fri Oct 31 2008 Panu Matilainen <pmatilai(a)redhat.com>
- adjust find-debuginfo for "file" output change (#468129)
--
1.5.4.1