[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PULL 20/37] qcow2: Give the refcount cach
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PULL 20/37] qcow2: Give the refcount cache the minimum possible size by default |
Date: |
Mon, 28 May 2018 10:58:17 +0200 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Mon 28 May 2018 10:38:55 AM CEST, Kevin Wolf wrote:
>> > + if (!refcount_cache_size_set) {
>> > + *refcount_cache_size = MIN_REFCOUNT_CACHE_SIZE *
>> > s->cluster_size;
>>
>> ...but in the else clause down here, we don't have the cast, and
>> Coverity complains that we evaluate a 32-bit result and then put it
>> in a 64-bit variable. Should this have the (uint64_t) cast as well ?
I suppose that's not because we put a 32-bit result in a 64-bit
variable, but because it could theoretically overflow (if
s->cluster_size > INT32_MAX / 4).
> It's a false positive, MIN_REFCOUNT_CACHE_SIZE is 4 and
> s->cluster_size is at most 2 MB, so this will never overflow.
>
> I guess we can change the code anyway to silence it?
Same opinion here, no problem with adding a cast to silence the warning.
Berto
- [Qemu-block] [PULL 16/37] blockjob: Add block_job_driver(), (continued)
- [Qemu-block] [PULL 16/37] blockjob: Add block_job_driver(), Kevin Wolf, 2018/05/15
- [Qemu-block] [PULL 14/37] blockjob: Implement block_job_set_speed() centrally, Kevin Wolf, 2018/05/15
- [Qemu-block] [PULL 19/37] specs/qcow2: Clarify that compressed clusters have the COPIED bit reset, Kevin Wolf, 2018/05/15
- [Qemu-block] [PULL 13/37] blockjob: Move RateLimit to BlockJob, Kevin Wolf, 2018/05/15
- [Qemu-block] [PULL 12/37] blockjob: Wrappers for progress counter access, Kevin Wolf, 2018/05/15
- [Qemu-block] [PULL 17/37] iotests: Split 214 off of 122, Kevin Wolf, 2018/05/15
- [Qemu-block] [PULL 22/37] iotests: Add failure matching to common.qemu, Kevin Wolf, 2018/05/15
- [Qemu-block] [PULL 20/37] qcow2: Give the refcount cache the minimum possible size by default, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 21/37] docs: Document the new default sizes of the qcow2 caches, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 26/37] block: Add BDRV_REQ_WRITE_UNCHANGED flag, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 28/37] block/quorum: Support BDRV_REQ_WRITE_UNCHANGED, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 18/37] Fix error message about compressed clusters with OFLAG_COPIED, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 23/37] iotests: Skip 181 and 201 without userfaultfd, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 27/37] block: Set BDRV_REQ_WRITE_UNCHANGED for COR writes, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 25/37] block: BLK_PERM_WRITE includes ..._UNCHANGED, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 31/37] iotests: Copy 197 for COR filter driver, Kevin Wolf, 2018/05/15