From 21eb1450cc2541e23dedf1a0dec24e3313ab8739 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 14 Nov 2011 09:53:25 +0100 Subject: s3:smbd/aio: pass ECANCELED to the smb2 aio handlers metze --- source3/smbd/aio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/smbd/aio.c') 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" -- cgit