diff --git a/source3/smbd/server.c b/source3/smbd/server.c index b83cfdd33f6..048d2138ad0 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -283,8 +283,10 @@ static int smbd_parent_ctdb_reconfigured( * Someone from the family died, validate our locks */ - messaging_send_buf(msg_ctx, messaging_server_id(msg_ctx), - MSG_SMB_BRL_VALIDATE, NULL, 0); + if (am_parent) { + messaging_send_buf(msg_ctx, am_parent->cleanupd, + MSG_SMB_BRL_VALIDATE, NULL, 0); + } return 0; } @@ -545,8 +547,8 @@ static void cleanup_timeout_fn(struct tevent_context *event_ctx, 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, - messaging_server_id(parent->msg_ctx), + + messaging_send_buf(parent->msg_ctx, parent->cleanupd, MSG_SMB_BRL_VALIDATE, NULL, 0); } @@ -1003,8 +1005,6 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent, messaging_register(msg_ctx, NULL, MSG_SMB_STAT_CACHE_DELETE, smb_stat_cache_delete); messaging_register(msg_ctx, NULL, MSG_DEBUG, smbd_msg_debug); - messaging_register(msg_ctx, NULL, MSG_SMB_BRL_VALIDATE, - brl_revalidate); messaging_register(msg_ctx, NULL, MSG_SMB_FORCE_TDIS, smb_parent_send_to_children); messaging_register(msg_ctx, NULL, MSG_SMB_KILL_CLIENT_IP, diff --git a/source3/smbd/smbd_cleanupd.c b/source3/smbd/smbd_cleanupd.c index e931a28e8a9..6b423e3cd2c 100644 --- a/source3/smbd/smbd_cleanupd.c +++ b/source3/smbd/smbd_cleanupd.c @@ -17,13 +17,14 @@ * along with this program. If not, see . */ -#include "replace.h" +#include "includes.h" #include "smbd_cleanupd.h" #include "lib/util_procid.h" #include "lib/util/tevent_ntstatus.h" #include "lib/util/debug.h" #include "smbprofile.h" #include "serverid.h" +#include "locking/proto.h" struct smbd_cleanupd_state { pid_t parent_pid; @@ -65,6 +66,12 @@ struct tevent_req *smbd_cleanupd_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, ev); } + status = messaging_register(msg, NULL, MSG_SMB_BRL_VALIDATE, + brl_revalidate); + if (tevent_req_nterror(req, status)) { + return tevent_req_post(req, ev); + } + return req; }