From nobody Sun Oct 5 21:14:36 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1542248135749294.04940868082895; Wed, 14 Nov 2018 18:15:35 -0800 (PST) Received: from localhost ([::1]:35662 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gN7Bp-00030j-ME for importer@patchew.org; Wed, 14 Nov 2018 21:15:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gN70x-0002SI-C8 for qemu-devel@nongnu.org; Wed, 14 Nov 2018 21:04:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gN70v-0005mg-U3 for qemu-devel@nongnu.org; Wed, 14 Nov 2018 21:04:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6462) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gN70s-0005lA-MY; Wed, 14 Nov 2018 21:04:10 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D4B6EC049D7A; Thu, 15 Nov 2018 02:04:09 +0000 (UTC) Received: from red.redhat.com (ovpn-123-32.rdu2.redhat.com [10.10.123.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB09760BF7; Thu, 15 Nov 2018 02:04:02 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Wed, 14 Nov 2018 20:03:33 -0600 Message-Id: <20181115020334.1189829-13-eblake@redhat.com> In-Reply-To: <20181115020334.1189829-1-eblake@redhat.com> References: <20181115020334.1189829-1-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 15 Nov 2018 02:04:09 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 12/13] block: Document need for audit of read/write 64-bit cleanness X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, Josh Durgin , qemu-block@nongnu.org, Stefan Weil , Jeff Cody , Max Reitz , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" At this time, any block driver that has not been audited for 64-bit cleanness, but which uses byte-based callbacks, should explicitly document that the driver wants the block layer to cap things at 2G. This patch has no semantic change. And it shows that the things I'm not interested in auditing are: bochs, cloop, dmg, file-win32, qcow, rbd, vvfat, vxhs Signed-off-by: Eric Blake --- block/bochs.c | 1 + block/cloop.c | 1 + block/dmg.c | 1 + block/file-win32.c | 2 ++ block/qcow.c | 1 + block/rbd.c | 1 + block/vvfat.c | 1 + block/vxhs.c | 1 + 8 files changed, 9 insertions(+) diff --git a/block/bochs.c b/block/bochs.c index 22e7d442113..cfa449ffb6f 100644 --- a/block/bochs.c +++ b/block/bochs.c @@ -202,6 +202,7 @@ fail: static void bochs_refresh_limits(BlockDriverState *bs, Error **errp) { bs->bl.request_alignment =3D BDRV_SECTOR_SIZE; /* No sub-sector I/O */ + bs->bl.max_transfer =3D BDRV_REQUEST_MAX_BYTES; } static int64_t seek_to_sector(BlockDriverState *bs, int64_t sector_num) diff --git a/block/cloop.c b/block/cloop.c index df2b85f7234..1ac0ed234d8 100644 --- a/block/cloop.c +++ b/block/cloop.c @@ -211,6 +211,7 @@ fail: static void cloop_refresh_limits(BlockDriverState *bs, Error **errp) { bs->bl.request_alignment =3D BDRV_SECTOR_SIZE; /* No sub-sector I/O */ + bs->bl.max_transfer =3D BDRV_REQUEST_MAX_BYTES; } static inline int cloop_read_block(BlockDriverState *bs, int block_num) diff --git a/block/dmg.c b/block/dmg.c index 50e91aef6d9..ea5553b6bf2 100644 --- a/block/dmg.c +++ b/block/dmg.c @@ -555,6 +555,7 @@ fail: static void dmg_refresh_limits(BlockDriverState *bs, Error **errp) { bs->bl.request_alignment =3D BDRV_SECTOR_SIZE; /* No sub-sector I/O */ + bs->bl.max_transfer =3D BDRV_REQUEST_MAX_BYTES; } static inline int is_sector_in_chunk(BDRVDMGState* s, diff --git a/block/file-win32.c b/block/file-win32.c index f1e2187f3bd..91b2dd9ed88 100644 --- a/block/file-win32.c +++ b/block/file-win32.c @@ -256,6 +256,7 @@ static void raw_probe_alignment(BlockDriverState *bs, E= rror **errp) /* XXX Does Windows support AIO on less than 512-byte alignment? */ bs->bl.request_alignment =3D 512; + bs->bl.max_transfer =3D BDRV_REQUEST_MAX_BYTES; } static void raw_parse_flags(int flags, bool use_aio, int *access_flags, @@ -716,6 +717,7 @@ static void hdev_refresh_limits(BlockDriverState *bs, E= rror **errp) { /* XXX Does Windows support AIO on less than 512-byte alignment? */ bs->bl.request_alignment =3D 512; + bs->bl.max_transfer =3D BDRV_REQUEST_MAX_BYTES; } static int hdev_open(BlockDriverState *bs, QDict *options, int flags, diff --git a/block/qcow.c b/block/qcow.c index 4518cb4c35e..ae6deacdb1f 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -618,6 +618,7 @@ static void qcow_refresh_limits(BlockDriverState *bs, E= rror **errp) * it's easier to let the block layer handle rounding than to * audit this code further. */ bs->bl.request_alignment =3D BDRV_SECTOR_SIZE; + bs->bl.max_transfer =3D BDRV_REQUEST_MAX_BYTES; } static coroutine_fn int qcow_co_preadv(BlockDriverState *bs, uint64_t offs= et, diff --git a/block/rbd.c b/block/rbd.c index 8a1a9f4b6e2..248e635b077 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -236,6 +236,7 @@ static void qemu_rbd_refresh_limits(BlockDriverState *b= s, Error **errp) { /* XXX Does RBD support AIO on less than 512-byte alignment? */ bs->bl.request_alignment =3D 512; + bs->bl.max_transfer =3D BDRV_REQUEST_MAX_BYTES; } diff --git a/block/vvfat.c b/block/vvfat.c index 915a05ae4f2..35f35328baf 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -1304,6 +1304,7 @@ fail: static void vvfat_refresh_limits(BlockDriverState *bs, Error **errp) { bs->bl.request_alignment =3D BDRV_SECTOR_SIZE; /* No sub-sector I/O */ + bs->bl.max_transfer =3D BDRV_REQUEST_MAX_BYTES; } static inline void vvfat_close_current_file(BDRVVVFATState *s) diff --git a/block/vxhs.c b/block/vxhs.c index 0cb0a007e90..5828f53432c 100644 --- a/block/vxhs.c +++ b/block/vxhs.c @@ -221,6 +221,7 @@ static void vxhs_refresh_limits(BlockDriverState *bs, E= rror **errp) { /* XXX Does VXHS support AIO on less than 512-byte alignment? */ bs->bl.request_alignment =3D 512; + bs->bl.max_transfer =3D BDRV_REQUEST_MAX_BYTES; } static int vxhs_init_and_ref(void) --=20 2.17.2