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 1289099 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 v4
db-5.3.28-rpm-lock-check.patch (text/plain), 2.56 KB, created by
Petr Kubat
on 2017-06-19 12:48:34 UTC
(
hide
)
Description:
rpm lock check patch v4
Filename:
MIME Type:
Creator:
Petr Kubat
Created:
2017-06-19 12:48:34 UTC
Size:
2.56 KB
patch
obsolete
>diff -up db-5.3.28/src/env/env_region.c.rpmlock db-5.3.28/src/env/env_region.c >--- db-5.3.28/src/env/env_region.c.rpmlock 2017-06-19 09:53:42.727715374 +0200 >+++ db-5.3.28/src/env/env_region.c 2017-06-19 09:55:28.195688220 +0200 >@@ -291,18 +291,23 @@ user_map_functions: > if (create_ok && > ret == DB_OLD_VERSION && > ENV_PRIMARY_LOCK(env, DB_LOCK_WRITE, 1) == 0) { >- if (FLD_ISSET(dbenv->verbose, DB_VERB_RECOVERY)) >- __db_msg(env, "Recreating idle environment"); >- F_SET(infop, REGION_CREATE_OK); >+ /* If the rpm transacrion lock is taken we cannot safely rebuild */ >+ if (!__rpm_lock_free(env)) >+ ENV_PRIMARY_UNLOCK(env); >+ else { >+ if (FLD_ISSET(dbenv->verbose, DB_VERB_RECOVERY)) >+ __db_msg(env, "Recreating idle environment"); >+ F_SET(infop, REGION_CREATE_OK); > >- /* >- * Detach from the environment region; we need to unmap it (and >- * close any file handle) so that we don't leak memory or files. >- */ >- DB_ASSERT(env, infop->rp == NULL); >- infop->rp = &tregion; >- (void)__env_sys_detach(env, infop, 0); >- goto creation; >+ /* >+ * Detach from the environment region; we need to unmap it (and >+ * close any file handle) so that we don't leak memory or files. >+ */ >+ DB_ASSERT(env, infop->rp == NULL); >+ infop->rp = &tregion; >+ (void)__env_sys_detach(env, infop, 0); >+ goto creation; >+ } > } > > if (renv->majver != DB_VERSION_MAJOR || >diff -up db-5.3.28/src/os/os_flock.c.rpmlock db-5.3.28/src/os/os_flock.c >--- db-5.3.28/src/os/os_flock.c.rpmlock 2017-06-19 09:52:49.418740004 +0200 >+++ db-5.3.28/src/os/os_flock.c 2017-06-19 09:53:16.428220866 +0200 >@@ -70,6 +70,34 @@ int __check_lock_fn(fn, pid) > } > > /* >+ * __rpm_lock_free -- >+ * Try to look at a lock used by rpm to see if libdb is being >+ * updated and it is safe to access its environment files. >+ */ >+ >+#define RPM_PATH SHAREDSTATEDIR "/rpm" >+#define RPMLOCK_PATH RPM_PATH "/.rpm.lock" >+ >+int __rpm_lock_free(env) >+ ENV *env; >+{ >+ int ret; >+ >+ /* No need to check the transaction lock if not in rpm */ >+ if (strstr(env->db_home, RPM_PATH) == NULL) >+ return 1; >+ >+ /* Assume it is safe to rebuild if the lock file does not exist */ >+ if (access(RPMLOCK_PATH, F_OK) && errno == ENOENT) >+ return 1; >+ >+ ret = __check_lock_fn(RPMLOCK_PATH, 0); >+ /* __check_lock_fn can return -1 on failure - return 0 (taken) instead */ >+ return ret == -1 ? 0: ret; >+ >+} >+ >+/* > * __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