From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23A8DC55199 for ; Mon, 27 Apr 2020 14:13:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E41DC206BF for ; Mon, 27 Apr 2020 14:13:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LjoZSUJJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E41DC206BF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jT4Vk-0006eW-0f for qemu-devel@archiver.kernel.org; Mon, 27 Apr 2020 10:13:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52228) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jT4Ur-0005Pl-BR for qemu-devel@nongnu.org; Mon, 27 Apr 2020 10:12:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jT4Up-0000bt-9s for qemu-devel@nongnu.org; Mon, 27 Apr 2020 10:12:31 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:56914 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jT4Uo-0000Xd-Rv for qemu-devel@nongnu.org; Mon, 27 Apr 2020 10:12:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587996749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wzwTIdLi9qsZj1mIh+E3/dAWL6VM3d39Ba80JXEGncY=; b=LjoZSUJJLJLBVxSZYDj+lPvLu0PpZYasdS90mPIXGrJbq/WdHz0Ftj5BDh6WjgwhqrCCQm 2MaYqyTOGkr+NK10wFrvGXuq3ZZycUspwSVVM2yrJ1QNPJ6qwWCBZDVkNXRXwZz1hZWMz/ bKfLy5JZTrQYG0JYuNv767YxPWyPs1A= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-203-EikEQtv7Nu-DR72vXf8zsw-1; Mon, 27 Apr 2020 10:12:22 -0400 X-MC-Unique: EikEQtv7Nu-DR72vXf8zsw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DB2A318FE863; Mon, 27 Apr 2020 14:12:19 +0000 (UTC) Received: from [10.10.116.80] (ovpn-116-80.rdu2.redhat.com [10.10.116.80]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E297327CD2; Mon, 27 Apr 2020 14:12:13 +0000 (UTC) Subject: Re: [PATCH v2 01/17] block/throttle-groups: throttle_group_co_io_limits_intercept(): 64bit bytes To: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org References: <20200427082325.10414-1-vsementsov@virtuozzo.com> <20200427082325.10414-2-vsementsov@virtuozzo.com> <4618c626-b757-f83a-d231-ef08eef9311d@redhat.com> From: Eric Blake Organization: Red Hat, Inc. Message-ID: <9f7404a1-8336-0b5f-ff4c-14749b7a33b5@redhat.com> 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 MIME-Version: 1.0 In-Reply-To: <4618c626-b757-f83a-d231-ef08eef9311d@redhat.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=207.211.31.120; envelope-from=eblake@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 02:05:28 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, sheepdog@lists.wpkg.org, ronniesahlberg@gmail.com, pavel.dovgaluk@ispras.ru, sw@weilnetz.de, pl@kamp.de, qemu-devel@nongnu.org, mreitz@redhat.com, den@openvz.org, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 4/27/20 5:05 AM, Philippe Mathieu-Daud=E9 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. >=20 > What is the meaning of negative bytes in this function? An error. It is more for consistency, in that we really cannot access=20 more than 63 bits of size information (off_t is signed, and network=20 protocols don't magically add a 64th bit to that underlying inherent=20 limitation of files and block devices). It may be worth adding assert(bytes >=3D 0), if that makes it easier to=20 prove we are only dealing with positive lengths. --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org