From c8c3a56b8bf0db89fdb8f548fe6016cb87d115ad Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 28 Oct 2004 06:45:28 +0000 Subject: 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) --- source4/ntvfs/common/brlock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/common/brlock.c b/source4/ntvfs/common/brlock.c index d4b152cf42..b43f0705a5 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); -- cgit