1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-08 05:57:51 +03:00

s3: smbd: Cause SMB2_OP_FLUSH to go synchronous in a compound anywhere but the last operation in the list.

Async read and write go synchronous in the same case,
so do the same here.

Remove knownfail.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15172

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Nov 17 05:55:42 UTC 2022 on sn-devel-184

(cherry picked from commit 26adf3344337f4e8d5d2107e6ba42e5ea7656372)
This commit is contained in:
Jeremy Allison 2022-10-20 15:19:05 -07:00 committed by Jule Anger
parent 61babd9af8
commit 1e94c94ae8
2 changed files with 14 additions and 2 deletions

View File

@ -1,2 +0,0 @@
^samba3.smb2.compound_async.flush_close\(fileserver\)
^samba3.smb2.compound_async.flush_flush\(fileserver\)

View File

@ -126,6 +126,8 @@ static struct tevent_req *smbd_smb2_flush_send(TALLOC_CTX *mem_ctx,
struct tevent_req *subreq;
struct smbd_smb2_flush_state *state;
struct smb_request *smbreq;
bool is_compound = false;
bool is_last_in_compound = false;
req = tevent_req_create(mem_ctx, &state,
struct smbd_smb2_flush_state);
@ -195,6 +197,18 @@ static struct tevent_req *smbd_smb2_flush_send(TALLOC_CTX *mem_ctx,
tevent_req_set_callback(subreq, smbd_smb2_flush_done, req);
is_compound = smbd_smb2_is_compound(smb2req);
is_last_in_compound = smbd_smb2_is_last_in_compound(smb2req);
if (is_compound && !is_last_in_compound) {
/*
* Can't go async if we're not the
* last request in a compound request.
* Cause this request to complete synchronously.
*/
smb2_request_set_async_internal(state->smb2req, true);
}
/* Ensure any close request knows about this outstanding IO. */
if (!aio_add_req_to_fsp(fsp, req)) {
tevent_req_nterror(req, NT_STATUS_NO_MEMORY);