From nobody Mon Feb 9 00:27:00 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1646643733; cv=none; d=zohomail.com; s=zohoarc; b=l8aylgcv844RgdK3iPHILU8edoLr9ysXnb1Ul8854YNOa0yloFV1OnDDhR7LLsN185TkcNyndOJEsgvGuHduyVMHLAhrSBgRGiPwn59Z51Zygil0QHFIHQOQtEu1HrJLzAWZV4c11NJL4IuaXqO0QC78YGgff31HRWzlkULwepM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646643733; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=j5gXxV0Jrolfb52KEe1k5nQJK0UtVTytD7cRVNYFLKU=; b=NzLakAVKL2ydGSNDvpQMpSD9K2wo656SLdAna9Ljddoe6DBweoOfuTkTtvRyGsXS9/kb546H9T8DTrZNA3t8+pQVqEX5b7k0AzCfBoxjAdYYBY0Syzq4mvPmSWdIaOf3Ct1buawyGLEsop38XL8u6lb8i4nwPM9IU50d5nQcudI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1646643733678362.9302925925532; Mon, 7 Mar 2022 01:02:13 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-8-oJUICJXwNKqk6OxPWTUOIA-1; Mon, 07 Mar 2022 04:01:29 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BCF072A59562; Mon, 7 Mar 2022 09:01:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BC77C0809D; Mon, 7 Mar 2022 09:01:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3A990193058B; Mon, 7 Mar 2022 09:01:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CD7E81931BFA for ; Mon, 7 Mar 2022 09:01:21 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A0E811F473; Mon, 7 Mar 2022 09:01:21 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 273981F470 for ; Mon, 7 Mar 2022 09:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646643733; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=j5gXxV0Jrolfb52KEe1k5nQJK0UtVTytD7cRVNYFLKU=; b=MDL7YY9U750Ga2Ky7DCN9dlr1qty6MAueWVNNuexJ53ASl6t6oE+bV9QbhQmOja61H15Wc kVt/LWcXwJpUocgK5mcDuhlOQu8W5DH5lOqtUAOkH8fkZPmf49CU6nySD83BUlj2L55fdj /cZvb2Fzo4KigSLQ7X0lLkjRj6RcboM= X-MC-Unique: oJUICJXwNKqk6OxPWTUOIA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 14/17] lxc_fuse: Prefer fuse_file_info::direct_io over mount option Date: Mon, 7 Mar 2022 10:01:04 +0100 Message-Id: <0d315f72736ecec18051971933f52fbea60f1b1d.1646643526.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1646643751091100001 Content-Type: text/plain; charset="utf-8" When mounting a FUSE it is possible to bypass kernel cache by specifying -odirect_io mount option. This is what we currently do. However, FUSEv3 has a different approach - the open callback (lxcProcOpen() in our case) can set direct_io member of fuse_file_info struct. This results in the same behaviour, but also works with both FUSEv1 and FUSEv3. The latter does not have the mount option and uses per file approach. Signed-off-by: Michal Privoznik --- src/lxc/lxc_fuse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c index b068d21cf4..73d3ab1015 100644 --- a/src/lxc/lxc_fuse.c +++ b/src/lxc/lxc_fuse.c @@ -117,6 +117,7 @@ lxcProcOpen(const char *path, if ((fi->flags & O_ACCMODE) !=3D O_RDONLY) return -EACCES; =20 + fi->direct_io =3D 1; return 0; } =20 @@ -329,7 +330,6 @@ lxcSetupFuse(struct virLXCFuse **f, =20 /* process name is libvirt_lxc */ if (fuse_opt_add_arg(&args, "libvirt_lxc") =3D=3D -1 || - fuse_opt_add_arg(&args, "-odirect_io") =3D=3D -1 || fuse_opt_add_arg(&args, "-oallow_other") =3D=3D -1 || fuse_opt_add_arg(&args, "-ofsname=3Dlibvirt") =3D=3D -1) goto error; --=20 2.34.1