]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/aio.c
aio: partial write should not return error code
[linux-2.6-omap-h63xx.git] / fs / aio.c
index 8a48ab0c278d9ef739ec4e53439e945f575115ca..26c1930889fafb0b191c202d2c5b7df4d8032ba8 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1347,6 +1347,13 @@ static ssize_t aio_rw_vect_retry(struct kiocb *iocb)
        if ((ret == 0) || (iocb->ki_left == 0))
                ret = iocb->ki_nbytes - iocb->ki_left;
 
+       /* If we managed to write some out we return that, rather than
+        * the eventual error. */
+       if (opcode == IOCB_CMD_PWRITEV
+           && ret < 0 && ret != -EIOCBQUEUED && ret != -EIOCBRETRY
+           && iocb->ki_nbytes - iocb->ki_left)
+               ret = iocb->ki_nbytes - iocb->ki_left;
+
        return ret;
 }