]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Return the correct status when a partially completed request is cancelled.
authorjhb <jhb@FreeBSD.org>
Tue, 24 May 2016 21:09:05 +0000 (21:09 +0000)
committerjhb <jhb@FreeBSD.org>
Tue, 24 May 2016 21:09:05 +0000 (21:09 +0000)
commitf913b0e3d54d3521ae7eb9f7b68ec2c4d357eb55
treee8c4f47accb21440768f43e2a8cf680e6a3f2710
parent3e61cae63a0cae47555a546715abf14de1d21520
Return the correct status when a partially completed request is cancelled.

After the previous changes to fix requests on blocking sockets to complete
across multiple operations, an edge case exists where a request can be
cancelled after it has partially completed.  POSIX doesn't appear to
dictate exactly how to handle this case, but in general I feel that
aio_cancel() should arrange to cancel any request it can, but that any
partially completed requests should return a partial completion rather
than ECANCELED.  To that end, fix the socket AIO cancellation routine to
return a short read/write if a partially completed request is cancelled
rather than ECANCELED.

Sponsored by: Chelsio Communications
sys/kern/sys_socket.c
tests/sys/aio/aio_test.c