From patchwork Tue Apr 2 12:49:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 10881643 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2DF1F1708 for ; Tue, 2 Apr 2019 12:58:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16400288C3 for ; Tue, 2 Apr 2019 12:58:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08F2B288CA; Tue, 2 Apr 2019 12:58:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A0FFA288C3 for ; Tue, 2 Apr 2019 12:58:06 +0000 (UTC) Received: from localhost ([127.0.0.1]:50445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBIzN-00038U-W0 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 02 Apr 2019 08:58:06 -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) 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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=1691320 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 @@ */ #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/stderr */ +/* + * 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. + */ +#define GLUSTER_MAX_TRANSFER (512 * MiB) #define GERR_INDEX_HINT "hint: check in 'server' array index '%d'\n" @@ -887,6 +894,11 @@ out: return ret; } +static void qemu_gluster_refresh_limits(BlockDriverState *bs, Error **errp) +{ + bs->bl.max_transfer = GLUSTER_MAX_TRANSFER; +} + static int qemu_gluster_reopen_prepare(BDRVReopenState *state, BlockReopenQueue *queue, Error **errp) { @@ -1544,6 +1556,7 @@ static BlockDriver bdrv_gluster = { .bdrv_co_pwrite_zeroes = qemu_gluster_co_pwrite_zeroes, #endif .bdrv_co_block_status = qemu_gluster_co_block_status, + .bdrv_refresh_limits = qemu_gluster_refresh_limits, .create_opts = &qemu_gluster_create_opts, .strong_runtime_opts = gluster_strong_open_opts, }; @@ -1574,6 +1587,7 @@ static BlockDriver bdrv_gluster_tcp = { .bdrv_co_pwrite_zeroes = qemu_gluster_co_pwrite_zeroes, #endif .bdrv_co_block_status = qemu_gluster_co_block_status, + .bdrv_refresh_limits = qemu_gluster_refresh_limits, .create_opts = &qemu_gluster_create_opts, .strong_runtime_opts = gluster_strong_open_opts, }; @@ -1604,6 +1618,7 @@ static BlockDriver bdrv_gluster_unix = { .bdrv_co_pwrite_zeroes = qemu_gluster_co_pwrite_zeroes, #endif .bdrv_co_block_status = qemu_gluster_co_block_status, + .bdrv_refresh_limits = qemu_gluster_refresh_limits, .create_opts = &qemu_gluster_create_opts, .strong_runtime_opts = gluster_strong_open_opts, }; @@ -1640,6 +1655,7 @@ static BlockDriver bdrv_gluster_rdma = { .bdrv_co_pwrite_zeroes = qemu_gluster_co_pwrite_zeroes, #endif .bdrv_co_block_status = qemu_gluster_co_block_status, + .bdrv_refresh_limits = qemu_gluster_refresh_limits, .create_opts = &qemu_gluster_create_opts, .strong_runtime_opts = gluster_strong_open_opts, };