Re: [PATCH v4] block: Fix integer promotion error in bdrv_getlength()

2020-11-05 Thread Max Reitz
On 05.11.20 16:51, Eric Blake wrote: Back in 2015, we attempted to fix error reporting for images that claimed to have more than INT64_MAX/512 sectors, but due to the type promotions caused by BDRV_SECTOR_SIZE being unsigned, this inadvertently forces all negative ret values to be slammed into -E

Re: [PATCH v4] block: Fix integer promotion error in bdrv_getlength()

2020-11-05 Thread Alberto Garcia
On Thu 05 Nov 2020 04:51:22 PM CET, Eric Blake wrote: > Back in 2015, we attempted to fix error reporting for images that > claimed to have more than INT64_MAX/512 sectors, but due to the type > promotions caused by BDRV_SECTOR_SIZE being unsigned, this > inadvertently forces all negative ret value

[PATCH v4] block: Fix integer promotion error in bdrv_getlength()

2020-11-05 Thread Eric Blake
Back in 2015, we attempted to fix error reporting for images that claimed to have more than INT64_MAX/512 sectors, but due to the type promotions caused by BDRV_SECTOR_SIZE being unsigned, this inadvertently forces all negative ret values to be slammed into -EFBIG rather than the original error. W