diff --git a/[refs] b/[refs] index 749f1cc5980f..53a785c63164 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d24517d793f21edab1a411da95f2c45cb88a84aa +refs/heads/master: 9cc54d40b8ca01fcefc9151044b6996565061d90 diff --git a/trunk/fs/bio.c b/trunk/fs/bio.c index 29a44c1b64c6..5720b940bb5f 100644 --- a/trunk/fs/bio.c +++ b/trunk/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); }