summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-04-12 15:04:08 -0700
committerJeremy Allison <jra@samba.org>2012-04-12 15:06:59 -0700
commitfd3848636498fa357ff0085a126e374a3e91d14b (patch)
tree33bc5838d879287ceb23b6c9c81f87dbe65c5ea2
parent95839102ad9c1b052924a99ee938991a305d1add (diff)
downloadsamba-fd3848636498fa357ff0085a126e374a3e91d14b.tar.gz
samba-fd3848636498fa357ff0085a126e374a3e91d14b.tar.bz2
samba-fd3848636498fa357ff0085a126e374a3e91d14b.zip
Fix return_fn when aio was cancelled. We need to return -1, errno = ECANCELED.
-rw-r--r--source3/modules/vfs_aio_fork.c5
-rw-r--r--source3/modules/vfs_aio_linux.c5
-rw-r--r--source3/modules/vfs_aio_pthread.c5
3 files changed, 15 insertions, 0 deletions
diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c
index d10cc9f40b..f3e8f7fda1 100644
--- a/source3/modules/vfs_aio_fork.c
+++ b/source3/modules/vfs_aio_fork.c
@@ -710,6 +710,11 @@ static ssize_t aio_fork_return_fn(struct vfs_handle_struct *handle,
child->aiocb = NULL;
+ if (child->cancelled) {
+ errno = ECANCELED;
+ return -1;
+ }
+
if (child->retval.size == -1) {
errno = child->retval.ret_errno;
}
diff --git a/source3/modules/vfs_aio_linux.c b/source3/modules/vfs_aio_linux.c
index aa65b94859..d152f35501 100644
--- a/source3/modules/vfs_aio_linux.c
+++ b/source3/modules/vfs_aio_linux.c
@@ -418,6 +418,11 @@ static ssize_t aio_linux_return_fn(struct vfs_handle_struct *handle,
pd->aiocb = NULL;
+ if (pd->cancelled) {
+ errno = ECANCELED;
+ return -1;
+ }
+
if (pd->ret_size == -1) {
errno = pd->ret_errno;
}
diff --git a/source3/modules/vfs_aio_pthread.c b/source3/modules/vfs_aio_pthread.c
index cb441bf756..36ce9ab9d1 100644
--- a/source3/modules/vfs_aio_pthread.c
+++ b/source3/modules/vfs_aio_pthread.c
@@ -333,6 +333,11 @@ static ssize_t aio_pthread_return_fn(struct vfs_handle_struct *handle,
pd->aiocb = NULL;
+ if (pd->cancelled) {
+ errno = ECANCELED;
+ return -1;
+ }
+
if (pd->ret_size == -1) {
errno = pd->ret_errno;
}