git.samba.org
/
sfrench
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a98f09a
)
g_lock: Avoid a double call to serverid_exist
author
Volker Lendecke
<vl@samba.org>
Mon, 13 Aug 2018 12:12:47 +0000
(14:12 +0200)
committer
Volker Lendecke
<vl@samba.org>
Tue, 14 Aug 2018 06:54:17 +0000
(08:54 +0200)
If we try to G_LOCK_READ while a G_LOCK_WRITE is active, we do the
serverid_exists call twice. Avoid that.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/g_lock.c
patch
|
blob
|
history
diff --git
a/source3/lib/g_lock.c
b/source3/lib/g_lock.c
index bffbd6bab4d937634306157e8223de72ebcddc54..c824f4b0a587110ffd13952cbbac647da7df5485 100644
(file)
--- a/
source3/lib/g_lock.c
+++ b/
source3/lib/g_lock.c
@@
-226,7
+226,8
@@
static NTSTATUS g_lock_trylock(struct db_record *rec, struct server_id self,
g_lock_get_rec(&lck, i, &check_rec);
- if (!serverid_exists(&check_rec.pid)) {
+ if ((check_rec.lock_type == G_LOCK_READ) &&
+ !serverid_exists(&check_rec.pid)) {
g_lock_rec_del(&lck, i);
modified = true;
}