Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 1284124 Details for
Bug 1394862
libdb: Assumes that internal condition variable layout never changes
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh90 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
rpm lock check patch v3
db-5.3.28-rpm-lock-check.patch (text/plain), 2.28 KB, created by
Petr Kubat
on 2017-06-01 10:55:52 UTC
(
hide
)
Description:
rpm lock check patch v3
Filename:
MIME Type:
Creator:
Petr Kubat
Created:
2017-06-01 10:55:52 UTC
Size:
2.28 KB
patch
obsolete
>diff -up db-5.3.28/src/env/env_region.c.rpmchk db-5.3.28/src/env/env_region.c >--- db-5.3.28/src/env/env_region.c.rpmchk 2017-06-01 12:09:49.191891965 +0200 >+++ db-5.3.28/src/env/env_region.c 2017-06-01 12:09:49.193891929 +0200 >@@ -289,7 +289,8 @@ user_map_functions: > > if (create_ok && > __env_check_recreate(env, renv, signature) == DB_OLD_VERSION && >- (ret = ENV_PRIMARY_LOCK(env, DB_LOCK_WRITE, 1)) == 0) { >+ (ret = ENV_PRIMARY_LOCK(env, DB_LOCK_WRITE, 1)) == 0 && >+ (ret = __rpm_lock_check(env)) == 0 ) { > if (FLD_ISSET(dbenv->verbose, DB_VERB_RECOVERY)) > __db_msg(env, "Recreating idle environment"); > F_SET(infop, REGION_CREATE_OK); >diff -up db-5.3.28/src/os/os_flock.c.rpmchk db-5.3.28/src/os/os_flock.c >--- db-5.3.28/src/os/os_flock.c.rpmchk 2017-06-01 12:09:49.191891965 +0200 >+++ db-5.3.28/src/os/os_flock.c 2017-06-01 12:16:28.309175645 +0200 >@@ -15,6 +15,53 @@ static int __os_filelocking_notsup __P(( > #endif > > /* >+ * __rpm_lock_check -- >+ * Try to acquire and release a lock used by rpm to see >+ * if libdb is being updated and it is safe to access >+ * its environment files. >+ * >+ * FIXME: This function leaks the file descriptor on purpose >+ * so that rpm's transaction lock is not dropped due to >+ * how fcntl locks interact with close(2). >+ */ >+ >+#define RPM_PATH SHAREDSTATEDIR "/rpm" >+#define RPMLOCK_PATH RPM_PATH "/.rpm.lock" >+ >+int __rpm_lock_check(env) >+ ENV *env; >+{ >+#ifdef HAVE_FCNTL >+ struct flock info; >+ int fd; >+ int ret; >+ >+ if (strstr(env->db_home, RPM_PATH) == NULL) >+ /* No need to check the transaction lock if not in rpm */ >+ return 0; >+ >+ fd = open(RPMLOCK_PATH, O_RDWR); >+ if (fd == -1) >+ return 1; >+ /* Try to get an exclusive lock on rpm's lock file */ >+ info.l_type = F_WRLCK; >+ info.l_whence = SEEK_SET; >+ info.l_start = 0; >+ info.l_len = 0; >+ info.l_pid = 0; >+ /* We do not want to hold so just check if we can get it */ >+ if ((ret = fcntl(fd, F_GETLK, &info)) != -1 && info.l_type == F_UNLCK) >+ /* Lock is not taken, the environment can be rebuilt */ >+ return 0; >+ else >+ return 1; >+#else >+ /* fcntl not supported, fail with error message */ >+ return __os_filelocking_notsup(env); >+#endif >+} >+ >+/* > * __os_fdlock -- > * Acquire/release a lock on a byte in a file. > *
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1394862
:
1279226
|
1283384
|
1284053
|
1284124
|
1287101
|
1289098
|
1289099