Changes between Version 1 and Version 2 of Ticket #8990, comment 8


Ignore:
Timestamp:
Jan 26, 2015, 11:03:11 AM (9 years ago)
Author:
kushalsingh007

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8990, comment 8

    v1 v2  
    111.Using {{{partition->Size() / partition->BlockSize() < UINT32_MAX}}} causes the condition to fail.
    22  For instance, If BlockSize = 2048 ={{{2^11}}}.Then partition->Size() < {{{2^32}}}*{{{2^11}}} or {{{2^43}}} which is 8TB.
    3 Thus clearly the condition fails.Also there can be overflow error using the previous    condition.
    4 2.Yeah I assumed the sector size to be 512 which is wrong in some cases. So I think the max limit is {{{UINT32_MAX * SECTOR_SIZE}}}, so how do I get the SectorSize directly?
    5 Any suggestions ?
     3Thus clearly the condition fails. Also there can be overflow error using the previous    condition. Moreover the offset wasn't been checked anywhere.
     4
     52.Yeah I assumed the sector size to be 512 , the max limit is {{{UINT32_MAX * SECTOR_SIZE}}}, but then since MBR assumes 512 bytes sectors , so I think that's fine.
     6
    673.I'll make a separate patch for B_BAD_VALUE part and remove the parenthesis.
     8
     9So, apart from the minor code cleanup , are there any other problems too?