Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 2ce943a in mainline


Ignore:
Timestamp:
2021-09-15T15:54:18Z (5 weeks ago)
Author:
Erik Kučák <riko98@…>
Children:
9ae84ae
Parents:
d5309df7
Message:

Fixed last bug with L2_index

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/qcow_bd/qcow_bd.c

    rd5309df7 r2ce943a  
    324324
    325325        /* Compute l2 table index from the offset  */
    326         uint64_t l2_table_index = (*offset >> header.cluster_bits) & (state.l2_size - 1);
    327 
     326        uint64_t l2_table_shift = (1 << header.l2_bits) - 1;
     327        uint64_t l2_table_index = (*offset >> header.cluster_bits) & l2_table_shift;
    328328        /* Reading cluster reference from the l2 table */
    329329        if (fseek(img, l2_table_reference + l2_table_index * sizeof(uint64_t), SEEK_SET) < 0) {
Note: See TracChangeset for help on using the changeset viewer.