Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp63560pxj; Thu, 3 Jun 2021 00:36:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFreLmXLWZWKXQNoOZjNTVEageBUgGWlLhw36CZccpn+vmxHDKuaceNVncOM9DE3UGouM0 X-Received: by 2002:aa7:cd42:: with SMTP id v2mr16184452edw.245.1622705787589; Thu, 03 Jun 2021 00:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622705787; cv=none; d=google.com; s=arc-20160816; b=V54WeJn7lhUCLtt6vlX2AxFHrdjsrKReWRB/YJTZrj1XQkl3v7QAcnn/WQ2uQVhK5a UCdC7jjIJtvBfcNP0L4kxrH0YtEGRIJpUt3G8u8/Vlgmd2cPuc/q/LXQUs3pG4yYykxj E9Wll85S94tv+sLCqUKoZ6Wi1xa1N0MiwLyYGUBTZKo2K8EHvC40rx6d1w4+qaudzsRD lQ2WDWjIXNqkFvB8uulxzJsP2AYdatZ3nxX8BffhtVYnrYcYGHcSYYreBrBYkEhubRJt PXtey6Q1mqyH26xFzG2VtS+0sWtWIT6EWjwNtXKgpzw5PUreeiMILIfgPeLfw6iiZUN2 lZCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=KKbe1jzw6u59cYt4aDoGISv5CY+6YIh6310k7X9eQgA=; b=KrizY3gPvgQ98ZgzlA08q12xricIzuHRRD8kefg8cu4HI3M01Nj0R/6eYx+inwyuvO 1Gyp+HwBYQWPKAgGvYn75prrjh0OYyvL7lSXRdbcWPdYb559MXKM/77LK8dTc3+3Uq1j /XUq3/v0YEgWKL7jvJ62lj+j/3ZC4DyjoP/agtY/gweD+gPKvVJsqocYjfF6BzYloqkO J8vlZokUnAqw/Nxt/OXyEQN1WMSLfepR8AyGwnJWWHBRtb0SZwDXfovtXNObM1rPYOpN kS2CsIqsULqGhoPa1ndxibYU8hfwXhUCSiBq4SPDtwncapo5AewmKYdF78FPO35U4I13 7aIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cz6si1793661edb.555.2021.06.03.00.36.03; Thu, 03 Jun 2021 00:36:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229812AbhFCHgM convert rfc822-to-8bit (ORCPT + 99 others); Thu, 3 Jun 2021 03:36:12 -0400 Received: from us-smtp-delivery-44.mimecast.com ([205.139.111.44]:40247 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbhFCHgM (ORCPT ); Thu, 3 Jun 2021 03:36:12 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-494-J2cflW4UN0yhwxpUH8_qPg-1; Thu, 03 Jun 2021 03:34:25 -0400 X-MC-Unique: J2cflW4UN0yhwxpUH8_qPg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7794B180FD7A; Thu, 3 Jun 2021 07:34:24 +0000 (UTC) Received: from bahia.lan (ovpn-114-128.ams2.redhat.com [10.36.114.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 33E80620DE; Thu, 3 Jun 2021 07:34:19 +0000 (UTC) Date: Thu, 3 Jun 2021 09:34:17 +0200 From: Greg Kurz To: Max Reitz Cc: Miklos Szeredi , linux-fsdevel@vger.kernel.org, virtio-fs@redhat.com, linux-kernel@vger.kernel.org, Vivek Goyal Subject: Re: [Virtio-fs] [PATCH 3/4] fuse: Call vfs_get_tree() for submounts Message-ID: <20210603093333.154c23ac@bahia.lan> In-Reply-To: <7b4a3379-3004-98f2-841c-386ce62c888a@redhat.com> References: <20210525150230.157586-1-groug@kaod.org> <20210525150230.157586-4-groug@kaod.org> <7b4a3379-3004-98f2-841c-386ce62c888a@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kaod.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 27 May 2021 15:24:40 +0200 Max Reitz wrote: > On 25.05.21 17:02, Greg Kurz wrote: > > We recently fixed an infinite loop by setting the SB_BORN flag on > > submounts along with the write barrier needed by super_cache_count(). > > This is the job of vfs_get_tree() and FUSE shouldn't have to care > > about the barrier at all. > > > > Split out some code from fuse_dentry_automount() to a new dedicated > > fuse_get_tree_submount() handler for submounts and call vfs_get_tree(). > > > > The fs_private field of the filesystem context isn't used with > > submounts : hijack it to pass the FUSE inode of the mount point > > down to fuse_get_tree_submount(). > > What exactly do you mean by “isn’t used”? virtio_fs_init_fs_context() > still sets it (it is non-NULL in fuse_dentry_automount() after > fs_context_for_submount()). It does appear like it is never read, but > one thing that definitely would need to be done is for it to be freed > before putting mp_fi there. > Oops... yes it should. Thanks for the catch ! > So I think it may technically be fine to use this field, but then > virtio_fs_init_fs_context() shouldn’t set it for submounts (should be > discernible with fsc->purpose), and perhaps that should be a separate patch. > Yes, I'll do just that. > (Apart from that, this patch looks good to me, though.) > > Max > > > Finally, adapt virtiofs to use this. > > > > Signed-off-by: Greg Kurz > > --- > > fs/fuse/dir.c | 58 +++++++-------------------------------------- > > fs/fuse/fuse_i.h | 6 +++++ > > fs/fuse/inode.c | 44 ++++++++++++++++++++++++++++++++++ > > fs/fuse/virtio_fs.c | 3 +++ > > 4 files changed, 62 insertions(+), 49 deletions(-) >