|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
Official usptream patch #1
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
Source: http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/patch.4.6.21.html
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
*** dbinc/mp.h 2007-09-28 01:28:25.000000000 +1000
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
--- dbinc/mp.h 2008-02-14 01:22:09.000000000 +1100
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
***************
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
*** 639,644 ****
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
--- 639,647 ----
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
*/
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
#define MP_TRUNC_RECOVER 0x01
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
+ /* Private flags to DB_MPOOLFILE->close. */
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
+ #define DB_MPOOL_NOLOCK 0x002 /* Already have mpf locked. */
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
#if defined(__cplusplus)
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
#endif
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
*** mp/mp_fopen.c 2007-05-18 03:18:01.000000000 +1000
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
--- mp/mp_fopen.c 2008-02-12 16:09:42.000000000 +1100
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
***************
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
*** 888,894 ****
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
* when we try to flush them.
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
*/
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
deleted = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
! MUTEX_LOCK(dbenv, mfp->mutex);
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
if (F_ISSET(dbmfp, MP_MULTIVERSION))
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
--mfp->multiversion;
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
if (--mfp->mpf_cnt == 0 || LF_ISSET(DB_MPOOL_DISCARD)) {
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
--- 888,895 ----
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
* when we try to flush them.
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
*/
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
deleted = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
! if (!LF_ISSET(DB_MPOOL_NOLOCK))
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
! MUTEX_LOCK(dbenv, mfp->mutex);
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
if (F_ISSET(dbmfp, MP_MULTIVERSION))
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
--mfp->multiversion;
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
if (--mfp->mpf_cnt == 0 || LF_ISSET(DB_MPOOL_DISCARD)) {
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
***************
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
*** 909,921 ****
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
if (mfp->block_cnt == 0) {
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
if ((t_ret =
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
__memp_mf_discard(dbmp, mfp)) != 0 && ret == 0)
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
ret = t_ret;
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
deleted = 1;
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
! if (!deleted)
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
MUTEX_UNLOCK(dbenv, mfp->mutex);
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
done: /* Discard the DB_MPOOLFILE structure. */
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
--- 910,928 ----
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
if (mfp->block_cnt == 0) {
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
+ /*
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
+ * We should never discard this mp file if our caller
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
+ * is holding the lock on it. See comment in
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
+ * __memp_sync_file.
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
+ */
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
+ DB_ASSERT(dbenv, !LF_ISSET(DB_MPOOL_NOLOCK));
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
if ((t_ret =
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
__memp_mf_discard(dbmp, mfp)) != 0 && ret == 0)
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
ret = t_ret;
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
deleted = 1;
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
! if (!deleted && !LF_ISSET(DB_MPOOL_NOLOCK))
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
MUTEX_UNLOCK(dbenv, mfp->mutex);
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
done: /* Discard the DB_MPOOLFILE structure. */
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
*** mp/mp_sync.c 2007-06-02 04:32:44.000000000 +1000
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
--- mp/mp_sync.c 2008-02-12 16:09:42.000000000 +1100
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
***************
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
*** 755,761 ****
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
* This is important since we are called with the hash bucket
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
* locked. The mfp will get freed via the cleanup pass.
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
*/
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
! if (dbmfp != NULL && (t_ret = __memp_fclose(dbmfp, 0)) != 0 && ret == 0)
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
ret = t_ret;
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
--mfp->mpf_cnt;
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
--- 755,762 ----
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
* This is important since we are called with the hash bucket
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
* locked. The mfp will get freed via the cleanup pass.
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
*/
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
! if (dbmfp != NULL &&
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
! (t_ret = __memp_fclose(dbmfp, DB_MPOOL_NOLOCK)) != 0 && ret == 0)
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
ret = t_ret;
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
--mfp->mpf_cnt;
|
|
![](https://seccdn.libravatar.org/avatar/b35d1d8aafdac96dbcba718229f8845cd1f96064c96e607721ed6bab49feb5fc?s=16&d=retro) |
c3337e2 |
|