summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/aio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index a978c4f87c..2e9359e5ae 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -49,6 +49,7 @@ struct aio_extra {
DATA_BLOB outbuf;
struct lock_struct lock;
bool write_through;
+ bool pass_cancel;
int (*handle_completion)(struct aio_extra *ex, int errcode);
};
@@ -471,6 +472,7 @@ NTSTATUS schedule_smb2_aio_read(connection_struct *conn,
return NT_STATUS_NO_MEMORY;
}
aio_ex->handle_completion = handle_aio_smb2_read_complete;
+ aio_ex->pass_cancel = true;
init_strict_lock_struct(fsp, (uint64_t)smbreq->smbpid,
(uint64_t)startpos, (uint64_t)smb_maxcnt, READ_LOCK,
@@ -572,6 +574,7 @@ NTSTATUS schedule_aio_smb2_write(connection_struct *conn,
aio_ex->handle_completion = handle_aio_smb2_write_complete;
aio_ex->write_through = write_through;
+ aio_ex->pass_cancel = true;
init_strict_lock_struct(fsp, (uint64_t)smbreq->smbpid,
in_offset, (uint64_t)in_data.length, WRITE_LOCK,
@@ -883,7 +886,7 @@ static bool handle_aio_completed(struct aio_extra *aio_ex, int *perr)
/* Unlock now we're done. */
SMB_VFS_STRICT_UNLOCK(fsp->conn, fsp, &aio_ex->lock);
- if (err == ECANCELED) {
+ if (!aio_ex->pass_cancel && err == ECANCELED) {
/* If error is ECANCELED then don't return anything to the
* client. */
DEBUG(10,( "handle_aio_completed: operation mid %llu"