Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7adfa2ff3efa02a7a9f2632d2d2662d3e5eb5304
Commit:     7adfa2ff3efa02a7a9f2632d2d2662d3e5eb5304
Parent:     25478445c4a39318acbe08ba8df7945766cbb5b5
Author:     Rusty Russell <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 04:20:14 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 09:22:33 2008 -0800

    aio: partial write should not return error code
    
    When an AIO write gets an error after writing some data (eg.  ENOSPC), it
    should return the amount written already, not the error.  Just like write()
    is supposed to.
    
    This was found by the libaio test suite.
    
    Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
    Acked-By: Zach Brown <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/aio.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index 8a48ab0..26c1930 100644
--- 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;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to