[package] update sources to 4.7.25.3, bump release number (#6100)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@18340 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
56
libs/db47/patches/001-sequence_lock.patch
Normal file
56
libs/db47/patches/001-sequence_lock.patch
Normal file
@ -0,0 +1,56 @@
|
||||
diff -ruN db-4.7.25.NC/sequence/sequence.c db-4.7.25.NC.new/sequence/sequence.c
|
||||
--- db-4.7.25.NC/sequence/sequence.c 2008-05-05 22:25:09.000000000 +0200
|
||||
+++ db-4.7.25.NC.new/sequence/sequence.c 2009-11-08 12:50:27.000000000 +0100
|
||||
@@ -187,7 +187,11 @@
|
||||
if ((ret = __db_get_flags(dbp, &tflags)) != 0)
|
||||
goto err;
|
||||
|
||||
- if (DB_IS_READONLY(dbp)) {
|
||||
+ /*
|
||||
+ * We can let replication clients open sequences, but must
|
||||
+ * check later that they do not update them.
|
||||
+ */
|
||||
+ if (F_ISSET(dbp, DB_AM_RDONLY)) {
|
||||
ret = __db_rdonly(dbp->env, "DB_SEQUENCE->open");
|
||||
goto err;
|
||||
}
|
||||
@@ -244,6 +248,11 @@
|
||||
if ((ret != DB_NOTFOUND && ret != DB_KEYEMPTY) ||
|
||||
!LF_ISSET(DB_CREATE))
|
||||
goto err;
|
||||
+ if (IS_REP_CLIENT(env) &&
|
||||
+ !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
|
||||
+ ret = __db_rdonly(env, "DB_SEQUENCE->open");
|
||||
+ goto err;
|
||||
+ }
|
||||
ret = 0;
|
||||
|
||||
rp = &seq->seq_record;
|
||||
@@ -296,7 +305,12 @@
|
||||
*/
|
||||
rp = seq->seq_data.data;
|
||||
if (rp->seq_version == DB_SEQUENCE_OLDVER) {
|
||||
-oldver: rp->seq_version = DB_SEQUENCE_VERSION;
|
||||
+oldver: if (IS_REP_CLIENT(env) &&
|
||||
+ !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
|
||||
+ ret = __db_rdonly(env, "DB_SEQUENCE->open");
|
||||
+ goto err;
|
||||
+ }
|
||||
+ rp->seq_version = DB_SEQUENCE_VERSION;
|
||||
if (!F_ISSET(env, ENV_LITTLEENDIAN)) {
|
||||
if (IS_DB_AUTO_COMMIT(dbp, txn)) {
|
||||
if ((ret =
|
||||
@@ -707,6 +721,13 @@
|
||||
|
||||
MUTEX_LOCK(env, seq->mtx_seq);
|
||||
|
||||
+ if (handle_check && IS_REP_CLIENT(env) &&
|
||||
+ !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
|
||||
+ ret = __db_rdonly(env, "DB_SEQUENCE->get");
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
if (rp->seq_min + delta > rp->seq_max) {
|
||||
__db_errx(env, "Sequence overflow");
|
||||
ret = EINVAL;
|
Reference in New Issue
Block a user