]>
Commit | Line | Data |
---|---|---|
9b0ff0a0 MT |
1 | Submitted By: Dan Nicholson <dnicholson AT linuxfromscratch DOT org> |
2 | Date: 2006-09-02 | |
3 | Initial Package Version: 4.4.20 | |
4 | Origin: Upstream - http://www.sleepycat.com/update/4.4.20/patch.4.4.20.html | |
5 | Description: Bug fixes provided by the developer. Contains patches 1-4. | |
6 | ||
7 | diff -pNur db-4.4.20.orig/db/db_cam.c db-4.4.20/db/db_cam.c | |
8 | --- db-4.4.20.orig/db/db_cam.c 2006-01-10 16:19:21.000000000 +0000 | |
9 | +++ db-4.4.20/db/db_cam.c 2006-08-03 14:31:20.220319610 +0000 | |
10 | @@ -579,11 +579,12 @@ __db_c_get(dbc_arg, key, data, flags) | |
11 | flags == DB_NEXT || flags == DB_NEXT_DUP || flags == DB_PREV)) { | |
12 | if (tmp_rmw && (ret = dbc_arg->c_am_writelock(dbc_arg)) != 0) | |
13 | return (ret); | |
14 | - if ((ret = __db_c_idup(cp->opd, &opd, DB_POSITION)) != 0) | |
15 | + if (F_ISSET(dbc_arg, DBC_TRANSIENT)) | |
16 | + opd = cp->opd; | |
17 | + else if ((ret = __db_c_idup(cp->opd, &opd, DB_POSITION)) != 0) | |
18 | return (ret); | |
19 | ||
20 | - switch (ret = | |
21 | - opd->c_am_get(opd, key, data, flags, NULL)) { | |
22 | + switch (ret = opd->c_am_get(opd, key, data, flags, NULL)) { | |
23 | case 0: | |
24 | goto done; | |
25 | case DB_NOTFOUND: | |
26 | @@ -596,12 +597,18 @@ __db_c_get(dbc_arg, key, data, flags) | |
27 | if ((ret = __db_c_close(opd)) != 0) | |
28 | goto err; | |
29 | opd = NULL; | |
30 | + if (F_ISSET(dbc_arg, DBC_TRANSIENT)) | |
31 | + cp->opd = NULL; | |
32 | break; | |
33 | } | |
34 | goto err; | |
35 | default: | |
36 | goto err; | |
37 | } | |
38 | + } else if (cp->opd != NULL && F_ISSET(dbc_arg, DBC_TRANSIENT)) { | |
39 | + if ((ret = __db_c_close(cp->opd)) != 0) | |
40 | + goto err; | |
41 | + cp->opd = NULL; | |
42 | } | |
43 | ||
44 | /* | |
45 | diff -pNur db-4.4.20.orig/mp/mp_fget.c db-4.4.20/mp/mp_fget.c | |
46 | --- db-4.4.20.orig/mp/mp_fget.c 2005-10-12 17:53:36.000000000 +0000 | |
47 | +++ db-4.4.20/mp/mp_fget.c 2006-08-03 14:31:20.223318410 +0000 | |
48 | @@ -587,8 +587,11 @@ alloc: /* | |
49 | */ | |
50 | if (state != SECOND_MISS && bhp->ref == 1) { | |
51 | bhp->priority = UINT32_MAX; | |
52 | - SH_TAILQ_REMOVE(&hp->hash_bucket, bhp, hq, __bh); | |
53 | - SH_TAILQ_INSERT_TAIL(&hp->hash_bucket, bhp, hq); | |
54 | + if (SH_TAILQ_FIRST(&hp->hash_bucket, __bh) != | |
55 | + SH_TAILQ_LAST(&hp->hash_bucket, hq, __bh)) { | |
56 | + SH_TAILQ_REMOVE(&hp->hash_bucket, bhp, hq, __bh); | |
57 | + SH_TAILQ_INSERT_TAIL(&hp->hash_bucket, bhp, hq); | |
58 | + } | |
59 | hp->hash_priority = | |
60 | SH_TAILQ_FIRSTP(&hp->hash_bucket, __bh)->priority; | |
61 | } | |
62 | diff -pNur db-4.4.20.orig/qam/qam_files.c db-4.4.20/qam/qam_files.c | |
63 | --- db-4.4.20.orig/qam/qam_files.c 2005-10-20 18:57:12.000000000 +0000 | |
64 | +++ db-4.4.20/qam/qam_files.c 2006-08-03 14:31:20.211323209 +0000 | |
65 | @@ -411,6 +411,12 @@ __qam_fremove(dbp, pgnoaddr) | |
66 | DB_APP_DATA, buf, 0, NULL, &real_name)) != 0) | |
67 | goto err; | |
68 | #endif | |
69 | + | |
70 | + mpf = array->mpfarray[offset].mpf; | |
71 | + /* This extent my already be marked for delete and closed. */ | |
72 | + if (mpf == NULL) | |
73 | + goto err; | |
74 | + | |
75 | /* | |
76 | * The log must be flushed before the file is deleted. We depend on | |
77 | * the log record of the last delete to recreate the file if we crash. | |
78 | @@ -418,7 +424,6 @@ __qam_fremove(dbp, pgnoaddr) | |
79 | if (LOGGING_ON(dbenv) && (ret = __log_flush(dbenv, NULL)) != 0) | |
80 | goto err; | |
81 | ||
82 | - mpf = array->mpfarray[offset].mpf; | |
83 | (void)__memp_set_flags(mpf, DB_MPOOL_UNLINK, 1); | |
84 | /* Someone could be real slow, let them close it down. */ | |
85 | if (array->mpfarray[offset].pinref != 0) | |
86 | diff -pNur db-4.4.20.orig/txn/txn.c db-4.4.20/txn/txn.c | |
87 | --- db-4.4.20.orig/txn/txn.c 2005-11-01 14:50:03.000000000 +0000 | |
88 | +++ db-4.4.20/txn/txn.c 2006-08-03 14:31:20.215321609 +0000 | |
89 | @@ -1049,12 +1049,14 @@ __txn_set_name(txn, name) | |
90 | return (ret); | |
91 | memcpy(txn->name, name, len); | |
92 | ||
93 | + TXN_SYSTEM_LOCK(dbenv); | |
94 | if (td->name != INVALID_ROFF) { | |
95 | __db_shalloc_free( | |
96 | &mgr->reginfo, R_ADDR(&mgr->reginfo, td->name)); | |
97 | td->name = INVALID_ROFF; | |
98 | } | |
99 | if ((ret = __db_shalloc(&mgr->reginfo, len, 0, &p)) != 0) { | |
100 | + TXN_SYSTEM_UNLOCK(dbenv); | |
101 | __db_err(dbenv, | |
102 | "Unable to allocate memory for transaction name"); | |
103 | ||
104 | @@ -1063,6 +1065,7 @@ __txn_set_name(txn, name) | |
105 | ||
106 | return (ret); | |
107 | } | |
108 | + TXN_SYSTEM_UNLOCK(dbenv); | |
109 | td->name = R_OFFSET(&mgr->reginfo, p); | |
110 | memcpy(p, name, len); | |
111 |