From fd3848636498fa357ff0085a126e374a3e91d14b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 12 Apr 2012 15:04:08 -0700 Subject: Fix return_fn when aio was cancelled. We need to return -1, errno = ECANCELED. --- source3/modules/vfs_aio_fork.c | 5 +++++ source3/modules/vfs_aio_linux.c | 5 +++++ source3/modules/vfs_aio_pthread.c | 5 +++++ 3 files changed, 15 insertions(+) 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; } -- cgit