Fix return_fn when aio was cancelled. We need to return -1, errno = ECANCELED.
authorJeremy Allison <jra@samba.org>
Thu, 12 Apr 2012 22:04:08 +0000 (15:04 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 12 Apr 2012 22:06:59 +0000 (15:06 -0700)
source3/modules/vfs_aio_fork.c
source3/modules/vfs_aio_linux.c
source3/modules/vfs_aio_pthread.c

index d10cc9f40bb4bf129bacacdcc8d55ca698c79ff9..f3e8f7fda173422985a08ecaa40c09c9dab4f160 100644 (file)
@@ -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;
        }
index aa65b948594ce153fc37aa9a7d5f7c310a89c919..d152f3550188137658b87e75f1e4e71a8b7054e2 100644 (file)
@@ -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;
        }
index cb441bf756976f007ed9e3a3978de23cce2e27a1..36ce9ab9d1c4c62a3fe8fa495df762ad6141479c 100644 (file)
@@ -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;
        }