summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-04-12 15:11:22 -0700
committerJeremy Allison <jra@samba.org>2012-04-12 15:11:22 -0700
commitda786cddd68d8777cad5e3d6c6fe5a3beac2a1a7 (patch)
treedf625dee97386f4ba4c941fcc0f719f6cfb20bf8
parentd399af30c183663f487bf4d086ec4377f84725b0 (diff)
downloadsamba-da786cddd68d8777cad5e3d6c6fe5a3beac2a1a7.tar.gz
samba-da786cddd68d8777cad5e3d6c6fe5a3beac2a1a7.tar.bz2
samba-da786cddd68d8777cad5e3d6c6fe5a3beac2a1a7.zip
We never cancel SMB1 aio, only SMB2 aio - and in this case we always return a value.
So pass_cancel is no longer needed.
-rw-r--r--source3/smbd/aio.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index 5e2d2b3dfe..aa8aee00fb 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -49,7 +49,6 @@ 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);
};
@@ -454,7 +453,6 @@ 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,
@@ -550,7 +548,6 @@ 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,
@@ -863,18 +860,16 @@ static bool handle_aio_completed(struct aio_extra *aio_ex, int *perr)
return False;
}
+ if (err == ECANCELED) {
+ DEBUG(10,( "handle_aio_completed: operation mid %llu canceled "
+ "for file %s\n",
+ (unsigned long long)aio_ex->smbreq->mid,
+ fsp_str_dbg(aio_ex->fsp)));
+ }
+
/* Unlock now we're done. */
SMB_VFS_STRICT_UNLOCK(fsp->conn, fsp, &aio_ex->lock);
- 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"
- " canceled\n",
- (unsigned long long)aio_ex->smbreq->mid));
- return True;
- }
-
err = aio_ex->handle_completion(aio_ex, err);
if (err) {
*perr = err; /* Only save non-zero errors. */