[PATCH] g_lock: open with LOCK_ORDER_3

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed Jun 14 15:51:42 UTC 2017


Hi!

IIRC this has been discussed here already: This fixes an xattr_tdb
cluster failure.

Review appreciated!

Thanks, Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 3e76b185580b0aaef2c13206273243ab36512c48 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Wed, 14 Jun 2017 13:57:56 +0200
Subject: [PATCH] g_lock: open with LOCK_ORDER_3

xattr_tdb needs g_lock in a clustered environment. Nobody else
uses LOCK_ORDER_3 at this moment, so this looks safe.

The last one to use this was dbwrap_watch.tdb, and that's gone. The only
other one was notify_index.tdb, and that's gone too.

Signed-off-by: Volker Lendecke <vl 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 1815796..e8e6b17 100644
--- a/source3/lib/g_lock.c
+++ b/source3/lib/g_lock.c
@@ -67,7 +67,7 @@ struct g_lock_ctx *g_lock_ctx_init(TALLOC_CTX *mem_ctx,
 	backend = 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 (backend == NULL) {
-- 
2.1.4



More information about the samba-technical mailing list