From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13460FF8873 for ; Thu, 30 Apr 2026 14:22:52 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wISGL-0003yy-VE; Thu, 30 Apr 2026 10:21:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIRIZ-0001BN-82; Thu, 30 Apr 2026 09:19:23 -0400 Received: from proxmox-new.maurer-it.com ([94.136.29.106]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIRIW-000764-7C; Thu, 30 Apr 2026 09:19:22 -0400 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 8D01A87615; Thu, 30 Apr 2026 15:07:50 +0200 (CEST) Message-ID: <72090fa4-2f4e-483d-9ceb-c19b8119a25d@proxmox.com> Date: Thu, 30 Apr 2026 15:07:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PULL 08/28] fuse: Set direct_io and parallel_direct_writes To: Kevin Wolf , qemu-block@nongnu.org, Hanna Czenczek Cc: qemu-devel@nongnu.org References: <20260310162622.333137-1-kwolf@redhat.com> <20260310162622.333137-9-kwolf@redhat.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20260310162622.333137-9-kwolf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777554369801 Received-SPF: pass client-ip=94.136.29.106; envelope-from=f.ebner@proxmox.com; helo=proxmox-new.maurer-it.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Dear Maintainers, Am 10.03.26 um 6:33 PM schrieb Kevin Wolf: > From: Hanna Czenczek > > In fuse_open(), set these flags: > - direct_io: We probably actually don't want to have the host page cache > be used for our exports. QEMU block exports are supposed to represent > the image as-is (and thus potentially changing). > This causes a change in iotest 308's reference output. > > - parallel_direct_writes: We can (now) cope with parallel writes, so we > should set this flag. For some reason, it doesn't seem to make an > actual performance difference with libfuse, but it does make a > difference without it, so let's set it. > (See "fuse: Copy write buffer content before polling" for further > discussion.) > > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Hanna Czenczek > Message-ID: <20260309150856.26800-9-hreitz@redhat.com> > Reviewed-by: Kevin Wolf > Signed-off-by: Kevin Wolf > --- > block/export/fuse.c | 2 ++ > tests/qemu-iotests/308.out | 2 +- > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/block/export/fuse.c b/block/export/fuse.c > index 0422cf4b8af..d0e3c6bf61f 100644 > --- a/block/export/fuse.c > +++ b/block/export/fuse.c > @@ -582,6 +582,8 @@ static void fuse_setattr(fuse_req_t req, fuse_ino_t inode, struct stat *statbuf, > static void fuse_open(fuse_req_t req, fuse_ino_t inode, > struct fuse_file_info *fi) > { > + fi->direct_io = true; unfortunately, turning on direct IO here breaks a use case with swtpm. Reproducer below [0], which fails with an error message /usr/bin/swtpm exit with status 256: after this commit. Dropping the FOPEN_DIRECT_IO flag in current master makes the reproducer work again. Should there be a BlockExportOptionsFuse property to control the direct IO flag and have it be opt-in to avoid this breakage (and potentially others)? Best Regards, Fiona [0]: > #!/bin/bash > rm /tmp/disk.qcow2 > rm /tmp/export.fuse > ./qemu-img create -f qcow2 /tmp/disk.qcow2 4M > touch /tmp/export.fuse > ( > ./storage-daemon/qemu-storage-daemon \ > --blockdev qcow2,node-name=node0,file.driver=file,file.filename=/tmp/disk.qcow2 \ > --export fuse,id=exp0,mountpoint=/tmp/export.fuse,node-name=node0,writable=true \ > --chardev socket,id=qmp,path=/run/qsd.qmp,server=on,wait=off \ > --monitor chardev=qmp,mode=control > ) & > sleep 1 # too lazy to do proper synchronization for the reproducer here > swtpm_setup --tpmstate file:///tmp/export.fuse --createek > echo '{"execute": "qmp_capabilities"}{"execute": "quit"}' | socat - /run/qsd.qmp