diff options
author | Volker Lendecke <vl@samba.org> | 2012-01-08 19:04:39 +0100 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2012-01-18 14:48:04 +0100 |
commit | 333c92384b0680b8f8e5198dd68d49b249b34ec7 (patch) | |
tree | 8042feeb87bf2a0f763b0972facca268a935a8c6 /source3/lib/dbwrap/dbwrap_rbt.c | |
parent | 45e61fcf61ed9863fbe2b116fe0763fc139bbe0d (diff) | |
download | samba-333c92384b0680b8f8e5198dd68d49b249b34ec7.tar.gz samba-333c92384b0680b8f8e5198dd68d49b249b34ec7.tar.xz samba-333c92384b0680b8f8e5198dd68d49b249b34ec7.zip |
s3: Enforce a lock order in dbwrap
This makes sure we do not deadlock from doing two dbwrap_fetch_locked in two
processes in different orders. At open time, we assign a strict order to all
databases. lock_order 1 will be locked first, lock_order 2 second. No two
records of the same lock order may be locked at the same time.
Diffstat (limited to 'source3/lib/dbwrap/dbwrap_rbt.c')
-rw-r--r-- | source3/lib/dbwrap/dbwrap_rbt.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source3/lib/dbwrap/dbwrap_rbt.c b/source3/lib/dbwrap/dbwrap_rbt.c index 2460418d1d..4fbb0bc1a0 100644 --- a/source3/lib/dbwrap/dbwrap_rbt.c +++ b/source3/lib/dbwrap/dbwrap_rbt.c @@ -435,6 +435,7 @@ struct db_context *db_open_rbt(TALLOC_CTX *mem_ctx) result->exists = db_rbt_exists; result->wipe = db_rbt_wipe; result->parse_record = db_rbt_parse_record; + result->lock_order = 0; return result; } |