[PATCH] Patch for bug 13416: cleanupd sends MSG_SMB_UNLOCK twice to interested peers

Ralph Böhme slow at samba.org
Wed May 2 10:05:30 UTC 2018


Hi!

Stumpled across this one while looking at the MSG_SMB_UNLOCK broadcast storm
issue.

MSG_SMB_UNLOCK should be send to smbd that are waiting on blocked                                
byte-range-locks when a lock holder died.     
                                              
In smbd_cleanupd_unlock() we do this twice: once via a broadcast and                             
then again via brl_revalidate() to processes that are actually recorded                          
in brlock.tdb.                                
                                              
As brl_revalidate() should already take care of signaling anyone who                             
would be interested in the message, there's no need to broadcast.

Attached patch removes the broadcast.

Please review carefully and push if ok. I'm still suspecting that I'm missing a
subtlety around MSG_SMB_UNLOCK...

Thanks!
-slow

-- 
Ralph Boehme, Samba Team       https://samba.org/
Samba Developer, SerNet GmbH   https://sernet.de/en/samba/
GPG Key Fingerprint:           FAE2 C608 8A24 2520 51C5
                               59E4 AA1E 9B71 2639 9E46
-------------- next part --------------
From e266ba03b95fcd13bf3c9dd42781f41f81a6d232 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Tue, 1 May 2018 09:53:36 +0200
Subject: [PATCH] s3:cleanupd: sends MSG_SMB_UNLOCK twice to interested peers

MSG_SMB_UNLOCK should be send to smbd that are waiting on blocked
byte-range-locks when a lock holder died.

In smbd_cleanupd_unlock() we do this twice: once via a broadcast and
then again via brl_revalidate() to processes that are actually recorded
in brlock.tdb.

As brl_revalidate() should already take care of signaling anyone who
would be interested in the message, there's no need to broadcast.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13416

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source3/smbd/smbd_cleanupd.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/source3/smbd/smbd_cleanupd.c b/source3/smbd/smbd_cleanupd.c
index a9b1e8a1137..6ed87207925 100644
--- a/source3/smbd/smbd_cleanupd.c
+++ b/source3/smbd/smbd_cleanupd.c
@@ -98,8 +98,6 @@ static void smbd_cleanupd_unlock(struct messaging_context *msg,
 	DBG_WARNING("Cleaning up brl and lock database after unclean "
 		    "shutdown\n");
 
-	messaging_send_all(msg, MSG_SMB_UNLOCK, NULL, 0);
-
 	brl_revalidate(msg, private_data, msg_type, server_id, data);
 }
 
-- 
2.13.6



More information about the samba-technical mailing list