From nobody Thu May 2 06:22:59 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) 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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1553770701924671.2007623080675; Thu, 28 Mar 2019 03:58:21 -0700 (PDT) Received: from localhost ([127.0.0.1]:34341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9SjW-0004wr-5v for importer@patchew.org; Thu, 28 Mar 2019 06:58:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9ShO-0003mu-3A for qemu-devel@nongnu.org; Thu, 28 Mar 2019 06:55:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h9Se9-0000rE-7I for qemu-devel@nongnu.org; Thu, 28 Mar 2019 06:52:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50106) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h9Se6-0000pl-T4; Thu, 28 Mar 2019 06:52:31 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F365882F5; Thu, 28 Mar 2019 10:52:29 +0000 (UTC) Received: from steredhat.redhat.com (ovpn-116-180.ams2.redhat.com [10.36.116.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 526105C28D; Thu, 28 Mar 2019 10:52:28 +0000 (UTC) From: Stefano Garzarella To: qemu-devel@nongnu.org Date: Thu, 28 Mar 2019 11:52:27 +0100 Message-Id: <20190328105227.74725-1-sgarzare@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 28 Mar 2019 10:52:29 +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] [PATCH RFC] 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: Kevin Wolf , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 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 --- RFC: Should I add a parameter to allow the user to modify the max_transfer variable? block/gluster.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/block/gluster.c b/block/gluster.c index af64330211..e1e4eaa525 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" @@ -37,6 +38,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 @@ -879,6 +886,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) { @@ -1536,6 +1548,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, }; @@ -1566,6 +1579,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, }; @@ -1596,6 +1610,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, }; @@ -1632,6 +1647,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