[PATCH] avoid lock oder violation between xattr.tdb and g_lock.tdb

Michael Adam obnox at samba.org
Tue Jul 12 14:20:06 UTC 2016


Found by running selftest in my (wip) clustered member
environment. xattr.tdb being of same lock-oder 2 as g_lock
prevents fetch_locked->transaction on xattr.tdb in a
clustered environment.

Review appreciated.

Cheers - Michael
-------------- next part --------------
From 9f9189c9eeecfb95804a1259fb9a097007068a29 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Thu, 22 May 2014 11:45:12 +0200
Subject: [PATCH] g_lock: avoid lock order violation with xattr_tdb

Bump g_lock lock order to 3 from 2 to move it out
of the way of xattr.tdb which also has lock-order 2.
This way, we can do ctdb transactions on xattr.tdb.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 source3/lib/g_lock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c
index 1928f5e..fc8ad9c 100644
--- a/source3/lib/g_lock.c
+++ b/source3/lib/g_lock.c
@@ -65,7 +65,7 @@ struct g_lock_ctx *g_lock_ctx_init(TALLOC_CTX *mem_ctx,
 	result->db = db_open(result, db_path, 0,
 			     TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
 			     O_RDWR|O_CREAT, 0600,
-			     DBWRAP_LOCK_ORDER_2,
+			     DBWRAP_LOCK_ORDER_3,
 			     DBWRAP_FLAG_NONE);
 	TALLOC_FREE(db_path);
 	if (result->db == NULL) {
-- 
2.5.5

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160712/8fdfe72e/signature.sig>


More information about the samba-technical mailing list