summaryrefslogtreecommitdiffstats
path: root/lib/dbwrap
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2014-01-27 17:20:56 +0100
committerStefan Metzmacher <metze@samba.org>2014-02-07 16:06:07 +0100
commit4eb57bd6e7e9cdb6de5cb7510267a71917cfe393 (patch)
tree173cf8f41d2a284fab7c600a4bab917033c4c2df /lib/dbwrap
parent7e766a0a8ade1f018015684c22bda82595a33d38 (diff)
downloadsamba-4eb57bd6e7e9cdb6de5cb7510267a71917cfe393.tar.gz
samba-4eb57bd6e7e9cdb6de5cb7510267a71917cfe393.tar.xz
samba-4eb57bd6e7e9cdb6de5cb7510267a71917cfe393.zip
dbwrap: introduce DBWRAP_LOCK_ORDER_NONE for lock order "0".
Ther are still some databases which are opened (locally) with lock oder 0, which means don't do lock oder checking, thereby circumventing this deadlock-prevention mechanism. Add a symbolic constant for this "0" to make this circumvention more explicit. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib/dbwrap')
-rw-r--r--lib/dbwrap/dbwrap.c2
-rw-r--r--lib/dbwrap/dbwrap.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/dbwrap/dbwrap.c b/lib/dbwrap/dbwrap.c
index 8270b63a1a2..3606617e2e8 100644
--- a/lib/dbwrap/dbwrap.c
+++ b/lib/dbwrap/dbwrap.c
@@ -212,7 +212,7 @@ static struct db_record *dbwrap_fetch_locked_internal(
struct db_record *rec;
struct dbwrap_lock_order_state *lock_order = NULL;
- if (db->lock_order != 0) {
+ if (db->lock_order != DBWRAP_LOCK_ORDER_NONE) {
lock_order = dbwrap_check_lock_order(db, mem_ctx);
if (lock_order == NULL) {
return NULL;
diff --git a/lib/dbwrap/dbwrap.h b/lib/dbwrap/dbwrap.h
index 1949d5f8e5e..03cc3f4a7b9 100644
--- a/lib/dbwrap/dbwrap.h
+++ b/lib/dbwrap/dbwrap.h
@@ -26,6 +26,7 @@ struct db_record;
struct db_context;
enum dbwrap_lock_order {
+ DBWRAP_LOCK_ORDER_NONE = 0, /* Don't check lock orders for this db. */
DBWRAP_LOCK_ORDER_1 = 1,
DBWRAP_LOCK_ORDER_2 = 2,
DBWRAP_LOCK_ORDER_3 = 3