summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2018-08-14 14:31:01 +0200
committerKarolin Seeger <kseeger@samba.org>2018-08-23 10:39:30 +0200
commita3297648fa049471cc6b3767e34d9b8731473bd9 (patch)
tree232f31910fa2dbe6ee05ab4a4e92ff7d8b1dd95a
parentcc4eed27367822c1829778cb0599c962b54e17f6 (diff)
downloadsamba-a3297648fa049471cc6b3767e34d9b8731473bd9.tar.gz
g_lock: Fix lock upgrades
Master has changed significantly, this is a minimum fix for 4.7 without cleaning up the code BUG: https://bugzilla.samba.org/show_bug.cgi?id=13195 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--selftest/knownfail.d/local-g-lock61
-rw-r--r--source3/lib/g_lock.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/selftest/knownfail.d/local-g-lock6 b/selftest/knownfail.d/local-g-lock6
deleted file mode 100644
index 14fd5c869d6..00000000000
--- a/selftest/knownfail.d/local-g-lock6
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.smbtorture_s3.LOCAL-G-LOCK6.smbtorture
diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c
index 76b4af5d974..a53f6a16dd0 100644
--- a/source3/lib/g_lock.c
+++ b/source3/lib/g_lock.c
@@ -329,6 +329,10 @@ static NTSTATUS g_lock_trylock(struct db_record *rec, struct server_id self,
* Delete stale conflicting entry
*/
locks[i] = locks[num_locks-1];
+ if (my_lock == num_locks-1) {
+ /* We just moved */
+ my_lock = i;
+ }
num_locks -= 1;
modified = true;
continue;