From: Jeremy Allison Date: Thu, 12 Apr 2012 22:04:08 +0000 (-0700) Subject: Fix return_fn when aio was cancelled. We need to return -1, errno = ECANCELED. X-Git-Tag: ldb-1.1.6~93 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fd3848636498fa357ff0085a126e374a3e91d14b;p=thirdparty%2Fsamba.git Fix return_fn when aio was cancelled. We need to return -1, errno = ECANCELED. --- diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c index d10cc9f40bb..f3e8f7fda17 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 aa65b948594..d152f355018 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 cb441bf7569..36ce9ab9d1c 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; }