summaryrefslogtreecommitdiffstats
path: root/source4/ntvfs/common/brlock.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-28 06:45:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:04:53 -0500
commitc8c3a56b8bf0db89fdb8f548fe6016cb87d115ad (patch)
tree0c777a9158dcbd538e708e92d20cc8b151adaebf /source4/ntvfs/common/brlock.c
parentc69b5f76427e7a73403acf16921c4084f4c281bb (diff)
downloadsamba-c8c3a56b8bf0db89fdb8f548fe6016cb87d115ad.tar.gz
samba-c8c3a56b8bf0db89fdb8f548fe6016cb87d115ad.tar.xz
samba-c8c3a56b8bf0db89fdb8f548fe6016cb87d115ad.zip
r3312: in the brlock code, we prevent lock stampedes by attempting to not
wakeup all pending locks at once. This change means that we only trigger this anti-stampede code for write locks, as for pending read locks the correct behaviour is to stampede (as they will all succeed) (This used to be commit 8021d1d74207db1204139309592b9d2f80f2bd0e)
Diffstat (limited to 'source4/ntvfs/common/brlock.c')
-rw-r--r--source4/ntvfs/common/brlock.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/ntvfs/common/brlock.c b/source4/ntvfs/common/brlock.c
index d4b152cf42e..b43f0705a51 100644
--- a/source4/ntvfs/common/brlock.c
+++ b/source4/ntvfs/common/brlock.c
@@ -338,7 +338,9 @@ static void brl_notify_unlock(struct brl_context *brl,
if (last_notice != -1 && brl_overlap(&locks[i], &locks[last_notice])) {
continue;
}
- last_notice = i;
+ if (locks[i].lock_type == PENDING_WRITE_LOCK) {
+ last_notice = i;
+ }
data.data = (void *)&locks[i].notify_ptr;
data.length = sizeof(void *);
messaging_send(brl->messaging_ctx, locks[i].context.server, MSG_BRL_RETRY, &data);