Skip to content

Commit aa78b82

Browse files
Vladimir Sementsov-Ogievskiyebblake
authored andcommitted
block-backend: drop INT_MAX restriction from blk_check_byte_request()
blk_check_bytes_request is called from blk_co_do_preadv, blk_co_do_pwritev_part, blk_co_do_pdiscard and blk_co_copy_range before (maybe) calling throttle_group_co_io_limits_intercept() (which has int64_t argument) and then calling corresponding bdrv_co_ function. bdrv_co_ functions are OK with int64_t bytes as well. So dropping the check for INT_MAX we just get same restrictions as in bdrv_ layer: discard and write-zeroes goes through bdrv_check_qiov_request() and are allowed to be 64bit. Other requests go through bdrv_check_request32() and still restricted by INT_MAX boundary. Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]> Message-Id: <[email protected]> Reviewed-by: Eric Blake <[email protected]> Signed-off-by: Eric Blake <[email protected]>
1 parent 1414971 commit aa78b82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/block-backend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ static int blk_check_byte_request(BlockBackend *blk, int64_t offset,
11661166
{
11671167
int64_t len;
11681168

1169-
if (bytes < 0 || bytes > INT_MAX) {
1169+
if (bytes < 0) {
11701170
return -EIO;
11711171
}
11721172

0 commit comments

Comments
 (0)