[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 03/17] block/io: use int64_t bytes parameter in bdrv_check
From: |
Alberto Garcia |
Subject: |
Re: [PATCH v3 03/17] block/io: use int64_t bytes parameter in bdrv_check_byte_request() |
Date: |
Mon, 11 May 2020 17:57:15 +0200 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Thu 30 Apr 2020 01:10:19 PM CEST, Vladimir Sementsov-Ogievskiy wrote:
> We are generally moving to int64_t for both offset and bytes parameters
> on all io paths.
>
> Main motivation is realization of 64-bit write_zeroes operation for
> fast zeroing large disk chunks, up to the whole disk.
>
> We chose signed type, to be consistent with off_t (which is signed) and
> with possibility for signed return type (where negative value means
> error).
>
> So, convert bdrv_check_byte_request() now.
>
> Patch-correctness audit by Eric Blake:
>
> This changes an unsigned to signed value on 64-bit machines, and
> additionally widens the parameter on 32-bit machines. Existing
> callers:
>
> bdrv_co_preadv_part() with 'unsigned int' - no impact
> bdrv_co_pwritev_part() with 'unsigned int' - no impact
> bdrv_co_copy_range_internal() with 'uint64_t' -
> potentially fixes a latent bug on 32-bit machines. Requires a
> larger audit to see how bdrv_co_copy_range() and friends are
> used:
>
> block/block-backend.c:blk_co_copy_range() - passes 'int', thus < 2G
> block/block-copy.c:block_copy_do_copy() -
> passes 'int64_t', but only after assert(nbytes < INT_MAX); also
> it has a BLOCK_COPY_MAX_COPY_RANGE set to 16M that factors into
> its calculations on how much to do per iteration
>
> So it looks like at present we are safe.
>
> Series: 64bit-block-status
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Berto
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v3 03/17] block/io: use int64_t bytes parameter in bdrv_check_byte_request(),
Alberto Garcia <=