Revision c2bc78b6

b/block/qcow2-refcount.c
747 747
    if (l1_table_offset != s->l1_table_offset) {
748 748
        l1_table = g_malloc0(align_offset(l1_size2, 512));
749 749
        l1_allocated = 1;
750
        if (bdrv_pread(bs->file, l1_table_offset,
751
                       l1_table, l1_size2) != l1_size2)
752
        {
753
            ret = -EIO;
750

  
751
        ret = bdrv_pread(bs->file, l1_table_offset, l1_table, l1_size2);
752
        if (ret < 0) {
754 753
            goto fail;
755 754
        }
756 755

  
......
802 801
                        }
803 802

  
804 803
                        if (refcount < 0) {
805
                            ret = -EIO;
804
                            ret = refcount;
806 805
                            goto fail;
807 806
                        }
808 807
                    }
......
833 832
                refcount = get_refcount(bs, l2_offset >> s->cluster_bits);
834 833
            }
835 834
            if (refcount < 0) {
836
                ret = -EIO;
835
                ret = refcount;
837 836
                goto fail;
838 837
            } else if (refcount == 1) {
839 838
                l2_offset |= QCOW_OFLAG_COPIED;

Also available in: Unified diff