From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 14 Apr 2021 13:56:22 +0200 From: Greg Kurz Message-ID: <20210414135622.4d677fd7@bahia.lan> In-Reply-To: References: <20210412145919.GE1184147@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [Virtio-fs] Query about fuse ->sync_fs and virtiofs List-Id: Development discussions about virtio-fs List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Miklos Szeredi Cc: virtio-fs-list , Linux fsdevel mailing list , Robert Krawitz , Vivek Goyal On Mon, 12 Apr 2021 17:08:26 +0200 Miklos Szeredi wrote: > On Mon, Apr 12, 2021 at 4:59 PM Vivek Goyal wrote: > > > > Hi Miklos, > > > > Robert Krawitz drew attention to the fact that fuse does not seem to > > have a ->sync_fs implementation. That probably means that in case of > > virtiofs, upon sync()/syncfs(), host cache will not be written back > > to disk. And that's not something people expect. > > > > I read somewhere that fuse did not implement ->sync_fs because file > > server might not be trusted and it could block sync(). > > > > In case of virtiofs, file server is trusted entity (w.r.t guest kernel), > > so it probably should be ok to implement ->sync_fs atleast for virtiofs? > > Yes, that looks like a good idea. > I've started looking into this. First observation is that implementing ->sync_fs() is file server agnostic, so if we want this to only be used by a trusted file server, we need to introduce such a notion in FUSE. Not sure where though... in struct fuse_fs_context maybe ? > Thanks, > Miklos 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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 400BBC433ED for ; Wed, 14 Apr 2021 14:25:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D4CF61155 for ; Wed, 14 Apr 2021 14:25:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233757AbhDNOZq (ORCPT ); Wed, 14 Apr 2021 10:25:46 -0400 Received: from 3.mo51.mail-out.ovh.net ([188.165.32.156]:46046 "EHLO 3.mo51.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233573AbhDNOZp (ORCPT ); Wed, 14 Apr 2021 10:25:45 -0400 X-Greylist: delayed 8937 seconds by postgrey-1.27 at vger.kernel.org; Wed, 14 Apr 2021 10:25:44 EDT Received: from mxplan5.mail.ovh.net (unknown [10.109.143.25]) by mo51.mail-out.ovh.net (Postfix) with ESMTPS id EA05627E9DE; Wed, 14 Apr 2021 13:56:24 +0200 (CEST) Received: from kaod.org (37.59.142.95) by DAG8EX1.mxp5.local (172.16.2.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Wed, 14 Apr 2021 13:56:23 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-95G0016c48b003-a9bb-4283-a696-378d1672d9bf, 27A2EAB91443B59947E9A6799839B739A3DEC47D) smtp.auth=groug@kaod.org X-OVh-ClientIp: 78.197.208.248 Date: Wed, 14 Apr 2021 13:56:22 +0200 From: Greg Kurz To: Miklos Szeredi CC: Vivek Goyal , virtio-fs-list , "Dr. David Alan Gilbert" , Linux fsdevel mailing list , Robert Krawitz Subject: Re: Query about fuse ->sync_fs and virtiofs Message-ID: <20210414135622.4d677fd7@bahia.lan> In-Reply-To: References: <20210412145919.GE1184147@redhat.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [37.59.142.95] X-ClientProxiedBy: DAG4EX1.mxp5.local (172.16.2.31) To DAG8EX1.mxp5.local (172.16.2.71) X-Ovh-Tracer-GUID: 4820488d-0e12-4f10-b72a-d7c46fce6b16 X-Ovh-Tracer-Id: 15593713713998633254 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduledrudeluddggeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvffukfgjfhfogggtgfhisehtjeertdertddvnecuhfhrohhmpefirhgvghcumfhurhiiuceoghhrohhugheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeefuddtieejjeevheekieeltefgleetkeetheettdeifeffvefhffelffdtfeeljeenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddrleehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehgrhhouhhgsehkrghougdrohhrghdprhgtphhtthhopehrkhhrrgifihhtiiesrhgvughhrghtrdgtohhm Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, 12 Apr 2021 17:08:26 +0200 Miklos Szeredi wrote: > On Mon, Apr 12, 2021 at 4:59 PM Vivek Goyal wrote: > > > > Hi Miklos, > > > > Robert Krawitz drew attention to the fact that fuse does not seem to > > have a ->sync_fs implementation. That probably means that in case of > > virtiofs, upon sync()/syncfs(), host cache will not be written back > > to disk. And that's not something people expect. > > > > I read somewhere that fuse did not implement ->sync_fs because file > > server might not be trusted and it could block sync(). > > > > In case of virtiofs, file server is trusted entity (w.r.t guest kernel), > > so it probably should be ok to implement ->sync_fs atleast for virtiofs? > > Yes, that looks like a good idea. > I've started looking into this. First observation is that implementing ->sync_fs() is file server agnostic, so if we want this to only be used by a trusted file server, we need to introduce such a notion in FUSE. Not sure where though... in struct fuse_fs_context maybe ? > Thanks, > Miklos