Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9cc54d40b8ca01fcefc9151044b6996565061d90
Commit:     9cc54d40b8ca01fcefc9151044b6996565061d90
Parent:     d24517d793f21edab1a411da95f2c45cb88a84aa
Author:     NeilBrown <[EMAIL PROTECTED]>
AuthorDate: Thu Sep 27 12:46:12 2007 +0200
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 09:25:57 2007 +0200

    Only call bi_end_io once for any bio
    
    Currently bi_end_io can be called multiple times as sub-requests
    complete.  However no ->bi_end_io function wants to know about that.
    So only call when the bio is complete.
    
    Signed-off-by: Neil Brown <[EMAIL PROTECTED]>
    
    ### Diffstat output
     ./fs/bio.c |    4 +++-
     1 file changed, 3 insertions(+), 1 deletion(-)
    
    diff .prev/fs/bio.c ./fs/bio.c
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
---
 fs/bio.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fs/bio.c b/fs/bio.c
index 29a44c1..5720b94 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1018,6 +1018,8 @@ void bio_endio(struct bio *bio, unsigned int bytes_done, 
int error)
 {
        if (error)
                clear_bit(BIO_UPTODATE, &bio->bi_flags);
+       else if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
+               error = -EIO;
 
        if (unlikely(bytes_done > bio->bi_size)) {
                printk("%s: want %u bytes done, only %u left\n", __FUNCTION__,
@@ -1028,7 +1030,7 @@ void bio_endio(struct bio *bio, unsigned int bytes_done, 
int error)
        bio->bi_size -= bytes_done;
        bio->bi_sector += (bytes_done >> 9);
 
-       if (bio->bi_end_io)
+       if (bio->bi_size && bio->bi_end_io)
                bio->bi_end_io(bio, bytes_done, error);
 }
 
-
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