|
From: | Eric Blake |
Subject: | Re: [PATCH v2 01/17] block/throttle-groups: throttle_group_co_io_limits_intercept(): 64bit bytes |
Date: | Mon, 27 Apr 2020 09:12:12 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
On 4/27/20 5:05 AM, Philippe Mathieu-Daudé wrote:
On 4/27/20 10:23 AM, Vladimir Sementsov-Ogievskiy wrote:The function is called from 64bit io handlers, and bytes is just passed to throttle_account() which is 64bit too (unsigned though). So, let's convert intermediate argument to 64bit too.What is the meaning of negative bytes in this function?
An error. It is more for consistency, in that we really cannot access more than 63 bits of size information (off_t is signed, and network protocols don't magically add a 64th bit to that underlying inherent limitation of files and block devices).
It may be worth adding assert(bytes >= 0), if that makes it easier to prove we are only dealing with positive lengths.
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |