summaryrefslogtreecommitdiff
path: root/source3/lib
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 /source3/lib
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>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/g_lock.c4
1 files changed, 4 insertions, 0 deletions
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;