From nobody Fri Dec 19 04:08:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 15542099179081016.0217168664875; Tue, 2 Apr 2019 05:58:37 -0700 (PDT) Received: from localhost ([127.0.0.1]:50445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBIzo-00038U-Ux for importer@patchew.org; Tue, 02 Apr 2019 08:58:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBIqz-0002Ji-5L for qemu-devel@nongnu.org; Tue, 02 Apr 2019 08:49:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hBIqx-00033J-L2 for qemu-devel@nongnu.org; Tue, 02 Apr 2019 08:49:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52122) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hBIqr-0002p0-RU; Tue, 02 Apr 2019 08:49:18 -0400 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 906D5301D681; Tue, 2 Apr 2019 12:49:15 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-34.ams2.redhat.com [10.36.117.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87A436842B; Tue, 2 Apr 2019 12:49:14 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 2 Apr 2019 14:49:01 +0200 Message-Id: <20190402124907.24421-4-kwolf@redhat.com> In-Reply-To: <20190402124907.24421-1-kwolf@redhat.com> References: <20190402124907.24421-1-kwolf@redhat.com> MIME-Version: 1.0 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.47]); Tue, 02 Apr 2019 12:49:15 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 3/9] block/gluster: limit the transfer size to 512 MiB 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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Stefano Garzarella Several versions of GlusterFS (3.12? -> 6.0.1) fail when the transfer size is greater or equal to 1024 MiB, so we are limiting the transfer size to 512 MiB to avoid this rare issue. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D1691320 Signed-off-by: Stefano Garzarella Reviewed-by: Niels de Vos Signed-off-by: Kevin Wolf --- block/gluster.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/block/gluster.c b/block/gluster.c index 51f184cbd8..e664ca4462 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -9,6 +9,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/units.h" #include #include "block/block_int.h" #include "block/qdict.h" @@ -41,6 +42,12 @@ #define GLUSTER_DEBUG_MAX 9 #define GLUSTER_OPT_LOGFILE "logfile" #define GLUSTER_LOGFILE_DEFAULT "-" /* handled in libgfapi as /dev/std= err */ +/* + * Several versions of GlusterFS (3.12? -> 6.0.1) fail when the transfer s= ize + * is greater or equal to 1024 MiB, so we are limiting the transfer size t= o 512 + * MiB to avoid this rare issue. + */ +#define GLUSTER_MAX_TRANSFER (512 * MiB) =20 #define GERR_INDEX_HINT "hint: check in 'server' array index '%d'\n" =20 @@ -887,6 +894,11 @@ out: return ret; } =20 +static void qemu_gluster_refresh_limits(BlockDriverState *bs, Error **errp) +{ + bs->bl.max_transfer =3D GLUSTER_MAX_TRANSFER; +} + static int qemu_gluster_reopen_prepare(BDRVReopenState *state, BlockReopenQueue *queue, Error **er= rp) { @@ -1544,6 +1556,7 @@ static BlockDriver bdrv_gluster =3D { .bdrv_co_pwrite_zeroes =3D qemu_gluster_co_pwrite_zeroes, #endif .bdrv_co_block_status =3D qemu_gluster_co_block_status, + .bdrv_refresh_limits =3D qemu_gluster_refresh_limits, .create_opts =3D &qemu_gluster_create_opts, .strong_runtime_opts =3D gluster_strong_open_opts, }; @@ -1574,6 +1587,7 @@ static BlockDriver bdrv_gluster_tcp =3D { .bdrv_co_pwrite_zeroes =3D qemu_gluster_co_pwrite_zeroes, #endif .bdrv_co_block_status =3D qemu_gluster_co_block_status, + .bdrv_refresh_limits =3D qemu_gluster_refresh_limits, .create_opts =3D &qemu_gluster_create_opts, .strong_runtime_opts =3D gluster_strong_open_opts, }; @@ -1604,6 +1618,7 @@ static BlockDriver bdrv_gluster_unix =3D { .bdrv_co_pwrite_zeroes =3D qemu_gluster_co_pwrite_zeroes, #endif .bdrv_co_block_status =3D qemu_gluster_co_block_status, + .bdrv_refresh_limits =3D qemu_gluster_refresh_limits, .create_opts =3D &qemu_gluster_create_opts, .strong_runtime_opts =3D gluster_strong_open_opts, }; @@ -1640,6 +1655,7 @@ static BlockDriver bdrv_gluster_rdma =3D { .bdrv_co_pwrite_zeroes =3D qemu_gluster_co_pwrite_zeroes, #endif .bdrv_co_block_status =3D qemu_gluster_co_block_status, + .bdrv_refresh_limits =3D qemu_gluster_refresh_limits, .create_opts =3D &qemu_gluster_create_opts, .strong_runtime_opts =3D gluster_strong_open_opts, }; --=20 2.20.1