From nobody Sun Nov 24 11:27:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1723478217; cv=none; d=zohomail.com; s=zohoarc; b=TU2MPQk323iv7usWptYsgNw1nq2+wLkZnAX8MBe6hYeux+JSYv+mJAY5rsmGHA9CxlPayVlWZPSyKrIZMlgTXdig8FZlWOlAcxqDapDN0d100HcqJC1TqPfdaPHI7gS2YHE4+ZRw5X9jEvNZyz494fW9f7AoaVr++pvMPilr6IY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723478217; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fIsw44iXbLWlNY+u+QEcCR4fOCHVyM70MAW+4gpzhuE=; b=TXZocigD+qsG/bhHsJhpZ7X2NwsI/V9I9cf7ECjZ5O9N7Df9DfnAmDUZJpVvfz/Tpl1xILeXlfbX8niz6rp6ZeQ7I5oQOUkclf8D008ZFujujNil/QJ8qRp8fTLdL0/IxHzpduC9yv/mFh9LcsQo1zYt4pMjW+8go9RN0JkxKOo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1723478217705986.1589698811669; Mon, 12 Aug 2024 08:56:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdXP6-0004qz-F5; Mon, 12 Aug 2024 11:56:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sdXOz-0004lt-O5 for qemu-devel@nongnu.org; Mon, 12 Aug 2024 11:56:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sdXOx-0004vP-Q4 for qemu-devel@nongnu.org; Mon, 12 Aug 2024 11:56:09 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-678-Q5fkYefZMQmnelPWLpmDUA-1; Mon, 12 Aug 2024 11:56:04 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B0538192538C; Mon, 12 Aug 2024 15:56:02 +0000 (UTC) Received: from localhost (unknown [10.2.16.252]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B56031955F66; Mon, 12 Aug 2024 15:56:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723478167; 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=fIsw44iXbLWlNY+u+QEcCR4fOCHVyM70MAW+4gpzhuE=; b=FD/3AvmF7dNBXgTG4g9DF5Ek1Gkn3N0+IpBZY/fM4NT1KFe9sBE3mObhm4sg6g75ZGwooA NfcYw7/NGkc2ByWwmyeWn5TZXFXc4MbASlVcwu0kaBn483xpDWzfloqx/3678v09K1XNLt v0bRU1cG0dcgWGodD0uQ1F/GUwYHOBY= X-MC-Unique: Q5fkYefZMQmnelPWLpmDUA-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Kevin Wolf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , qemu-block@nongnu.org, Thomas Huth , Paolo Bonzini , Hanna Reitz , Richard Henderson , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Hajnoczi , Stefano Garzarella , qemu-stable@nongnu.org, Eric Blake Subject: [PULL 1/1] block/blkio: use FUA flag on write zeroes only if supported Date: Mon, 12 Aug 2024 11:55:58 -0400 Message-ID: <20240812155558.88189-2-stefanha@redhat.com> In-Reply-To: <20240812155558.88189-1-stefanha@redhat.com> References: <20240812155558.88189-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.126, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1723478218777116600 From: Stefano Garzarella libblkio supports BLKIO_REQ_FUA with write zeros requests only since version 1.4.0, so let's inform the block layer that the blkio driver supports it only in this case. Otherwise we can have runtime errors as reported in https://issues.redhat.com/browse/RHEL-32878 Fixes: fd66dbd424 ("blkio: add libblkio block driver") Cc: qemu-stable@nongnu.org Buglink: https://issues.redhat.com/browse/RHEL-32878 Signed-off-by: Stefano Garzarella Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20240808080545.40744-1-sgarzare@redhat.com Signed-off-by: Stefan Hajnoczi --- meson.build | 2 ++ block/blkio.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index c2a050b844..81ecd4bae7 100644 --- a/meson.build +++ b/meson.build @@ -2305,6 +2305,8 @@ config_host_data.set('CONFIG_BLKIO', blkio.found()) if blkio.found() config_host_data.set('CONFIG_BLKIO_VHOST_VDPA_FD', blkio.version().version_compare('>=3D1.3.0')) + config_host_data.set('CONFIG_BLKIO_WRITE_ZEROS_FUA', + blkio.version().version_compare('>=3D1.4.0')) endif config_host_data.set('CONFIG_CURL', curl.found()) config_host_data.set('CONFIG_CURSES', curses.found()) diff --git a/block/blkio.c b/block/blkio.c index 3d9a2e764c..e0e765af63 100644 --- a/block/blkio.c +++ b/block/blkio.c @@ -899,8 +899,10 @@ static int blkio_open(BlockDriverState *bs, QDict *opt= ions, int flags, } =20 bs->supported_write_flags =3D BDRV_REQ_FUA | BDRV_REQ_REGISTERED_BUF; - bs->supported_zero_flags =3D BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | - BDRV_REQ_NO_FALLBACK; + bs->supported_zero_flags =3D BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK; +#ifdef CONFIG_BLKIO_WRITE_ZEROS_FUA + bs->supported_zero_flags |=3D BDRV_REQ_FUA; +#endif =20 qemu_mutex_init(&s->blkio_lock); qemu_co_mutex_init(&s->bounce_lock); --=20 2.46.0