[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 12/12] block-backend: drop INT_MAX restriction from blk_check_byt
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH 12/12] block-backend: drop INT_MAX restriction from blk_check_byte_request() |
Date: |
Wed, 6 Oct 2021 15:17:18 +0200 |
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 <vsementsov@virtuozzo.com>
---
block/block-backend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/block-backend.c b/block/block-backend.c
index e2b363ff63..21d8e88311 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -1166,7 +1166,7 @@ static int blk_check_byte_request(BlockBackend *blk,
int64_t offset,
{
int64_t len;
- if (bytes < 0 || bytes > INT_MAX) {
+ if (bytes < 0) {
return -EIO;
}
--
2.31.1
- Re: [PATCH 10/12] block-backend: convert blk_aio_ functions to int64_t bytes paramter, (continued)
[PATCH 11/12] block-backend: blk_pread, blk_pwrite: rename count parameter to bytes, Vladimir Sementsov-Ogievskiy, 2021/10/06
[PATCH 03/12] block-backend: convert blk_co_pwritev_part to int64_t bytes, Vladimir Sementsov-Ogievskiy, 2021/10/06
[PATCH 05/12] block-backend: rename _do_ helper functions to _co_do_, Vladimir Sementsov-Ogievskiy, 2021/10/06
[PATCH 04/12] block-backend: convert blk_co_pdiscard to int64_t bytes, Vladimir Sementsov-Ogievskiy, 2021/10/06
[PATCH 12/12] block-backend: drop INT_MAX restriction from blk_check_byte_request(),
Vladimir Sementsov-Ogievskiy <=
[PATCH 06/12] block-coroutine-wrapper.py: support BlockBackend first argument, Vladimir Sementsov-Ogievskiy, 2021/10/06
[PATCH 08/12] block-backend: convert blk_foo wrappers to use int64_t bytes parameter, Vladimir Sementsov-Ogievskiy, 2021/10/06
[PATCH 02/12] block-backend: make blk_co_preadv() 64bit, Vladimir Sementsov-Ogievskiy, 2021/10/06
[PATCH 07/12] block-backend: drop blk_prw, use block-coroutine-wrapper, Vladimir Sementsov-Ogievskiy, 2021/10/06
[PATCH 09/12] block-backend: convert blk_co_copy_range to int64_t bytes, Vladimir Sementsov-Ogievskiy, 2021/10/06