smbd: Move a message_send_all to the cleanupd
authorVolker Lendecke <vl@samba.org>
Mon, 16 Nov 2015 07:11:20 +0000 (08:11 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 16 Nov 2015 16:55:36 +0000 (17:55 +0100)
message_send_all traverses serverid.tdb, which can be expensive

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Nov 16 17:55:36 CET 2015 on sn-devel-104

source3/smbd/server.c
source3/smbd/smbd_cleanupd.c

index 9a8820c908c8d7fed3329a186f3df411ce2fc106..1dd4f898a51c56401598cc12a8204d72078b459c 100644 (file)
@@ -545,9 +545,6 @@ static void cleanup_timeout_fn(struct tevent_context *event_ctx,
 
        parent->cleanup_te = NULL;
 
-       DEBUG(1,("Cleaning up brl and lock database after unclean shutdown\n"));
-       message_send_all(parent->msg_ctx, MSG_SMB_UNLOCK, NULL, 0, NULL);
-
        messaging_send_buf(parent->msg_ctx, parent->cleanupd,
                           MSG_SMB_UNLOCK, NULL, 0);
 }
index 151d1e1292b9fc6522da0174e7d2150697e80e69..c940ef1f5fa1f341f12e4a917f8d267cc148d55e 100644 (file)
@@ -94,6 +94,11 @@ static void smbd_cleanupd_unlock(struct messaging_context *msg,
                                 struct server_id server_id,
                                 DATA_BLOB *data)
 {
+       DBG_WARNING("Cleaning up brl and lock database after unclean "
+                   "shutdown\n");
+
+       message_send_all(msg, MSG_SMB_UNLOCK, NULL, 0, NULL);
+
        brl_revalidate(msg, private_data, msg_type, server_id, data);
 }