1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

smbd: trigger notification for file and directory creation will be sent a wee bit later after dropping the sharemode lock

This will be a common pattern in the upcoming code dealing with Directory Lease
breaks: when checking for Directory Lease breaks on the parent directory, we
take the sharemode lock on the parent and hence by then must have dropped the
sharemode lock on the object that performs the Directory Lease break check. That
functionality will be later added to notify_fname().

This means the notification will be sent a wee bit later, but that's something
the change notification protocol has to live with anyway.

For Directory Leases the sequence to check for Directory Lease breaks is to call
MS-FSA 2.1.4.12 "Algorithm to Check for an Oplock Break" with
flags=PARENT_OBJECT at the end of each relevant operation, eg creating a file
asf, when processing of the operation that will call 2.1.4.12 is already
completed.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Ralph Boehme 2024-09-09 21:27:45 +02:00
parent d5dd40ef53
commit d2f50cad70

View File

@ -1508,10 +1508,6 @@ static NTSTATUS open_file(
return status;
}
}
notify_fname(conn, NOTIFY_ACTION_ADDED,
FILE_NOTIFY_CHANGE_FILE_NAME,
smb_fname->base_name);
}
} else {
if (!file_existed) {
@ -4652,6 +4648,13 @@ unlock:
smb_panic("share_mode_entry_prepare_unlock() failed!");
}
if (info == FILE_WAS_CREATED) {
notify_fname(conn,
NOTIFY_ACTION_ADDED,
FILE_NOTIFY_CHANGE_FILE_NAME,
smb_fname->base_name);
}
if (!NT_STATUS_IS_OK(status)) {
fd_close(fsp);
return status;
@ -5092,9 +5095,6 @@ done:
DBG_DEBUG("Created directory '%s'\n",
smb_fname_str_dbg(smb_dname));
notify_fname(conn, NOTIFY_ACTION_ADDED, FILE_NOTIFY_CHANGE_DIR_NAME,
smb_dname->base_name);
TALLOC_FREE(frame);
return NT_STATUS_OK;
@ -5521,6 +5521,13 @@ unlock:
smb_panic("share_mode_entry_prepare_unlock() failed!");
}
if (info == FILE_WAS_CREATED) {
notify_fname(conn,
NOTIFY_ACTION_ADDED,
FILE_NOTIFY_CHANGE_DIR_NAME,
smb_dname->base_name);
}
if (!NT_STATUS_IS_OK(status)) {
fd_close(fsp);
return status;