From 8a046ebf26286af3a994ab15b327d8361e7c8b3c Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Sat, 7 Sep 2024 16:24:01 +0200 Subject: [PATCH] smbd: move notify_fname() out of rmdir_internals() up to close_directory() This way we've already dropped the sharemode lock. Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- source3/smbd/close.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source3/smbd/close.c b/source3/smbd/close.c index b14955c511e..8909cd99c44 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -1125,9 +1125,6 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, struct files_struct *fsp) unlink_flags); if (ret == 0) { TALLOC_FREE(parent_fname); - notify_fname(conn, NOTIFY_ACTION_REMOVED, - FILE_NOTIFY_CHANGE_DIR_NAME, - smb_dname->base_name); return NT_STATUS_OK; } @@ -1460,10 +1457,6 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, struct files_struct *fsp) return status; } - notify_fname(conn, NOTIFY_ACTION_REMOVED, - FILE_NOTIFY_CHANGE_DIR_NAME, - smb_dname->base_name); - return status; } @@ -1599,6 +1592,13 @@ done: remove_pending_change_notify_requests_by_fid(fsp, notify_status); + if (lck_state.delete_object) { + notify_fname(conn, + NOTIFY_ACTION_REMOVED, + FILE_NOTIFY_CHANGE_DIR_NAME, + fsp->fsp_name->base_name); + } + status1 = fd_close(fsp); if (!NT_STATUS_IS_OK(status1)) { -- 2.47.3