struct aio_extra *aio_ex = NULL;
size_t min_aio_write_size = lp_aio_write_size(SNUM(conn));
struct tevent_req *req;
+ bool is_compound = false;
+ bool is_last_in_compound = false;
if (fsp_is_alternate_stream(fsp)) {
/* No AIO on streams yet */
return NT_STATUS_RETRY;
}
- if (smbd_smb2_is_compound(smbreq->smb2req)) {
+ is_compound = smbd_smb2_is_compound(smbreq->smb2req);
+ is_last_in_compound = smbd_smb2_is_last_in_compound(smbreq->smb2req);
+
+ if (is_compound && !is_last_in_compound) {
+ /*
+ * Only allow going async if this is the last
+ * request in a compound.
+ */
return NT_STATUS_RETRY;
}