Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4654979pxj; Tue, 8 Jun 2021 21:20:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkoMhFCGguNRy21EAzER7QqN++ex4DNALmgMYqj1d+g4PapKcBcADr93z9DRsrnWfbpHPB X-Received: by 2002:a17:906:56ca:: with SMTP id an10mr26575978ejc.328.1623212452913; Tue, 08 Jun 2021 21:20:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623212452; cv=none; d=google.com; s=arc-20160816; b=HNMUl5oELoQwzGJZ8ywn3OlMtI6thrCOaIXpunUCkIEpqkqeW2d7C/lRdcmSY2ttZd 9d1By1pYXlBFrKkRPXWhI7DcYE5mSuptHFy9oY9CgIbHbOLR1HNjFKBzcVjb4PZx4ohA j6aEZ4HiLAoiE7AkKJ93qKkmQbHq4gAKXTq5TF9LVVedir7lLRCe5XvE4MlwLTkGURD4 rTusA2Ii6DIwOjFKWEt85wOsRznclBIVasnDxRYxaWqWKW44o9PodQUYXj7JlOBg34r/ IZQqjV8adkCP1qEkFN/hSPT3jr/NrZJqw5aAhV0lXwVYQpTCBn9lmKWcbX5u77q4i6Pd 2SOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Br1rr7QBQj6YS5zJZEG2ZfZMvTHbAXZUz7RdIVHg2ZE=; b=GK5KD0k0FH3CmM88Sc2ST/sb/RJ4XGOh1Gjk7dO8BQa2T6RA2eMRn6aYNq0IPelJr/ GFL5ulYXJcgT8sg8tYwMBxgiuxwJL32dqrzOwYs9asqhA4oLDQs9r1fo2ufuYNQVU5kA B1bmLdJJw9K2yQEAtne+6v61nX62T8Agkxs/tiE+CCyFUxSQybl1UfYNGl1HGcnWKcX3 9b9S4r275xcKANlj0k+A4USN1sAB3dc0OVqF5ixTYmL5KvmD3pk4q5ejTPYUKhXkXz3y 0TiSAeoIgxeMWvn4syY/coXoiJz3JjQon/T6ZgKdJCewPcKBF90UV3iilAJW4MF7pF3R qVRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QlwGOHE7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si1391195edc.264.2021.06.08.21.20.29; Tue, 08 Jun 2021 21:20:52 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QlwGOHE7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232261AbhFHP14 (ORCPT + 99 others); Tue, 8 Jun 2021 11:27:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59527 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233167AbhFHP1d (ORCPT ); Tue, 8 Jun 2021 11:27:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623165932; 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=Br1rr7QBQj6YS5zJZEG2ZfZMvTHbAXZUz7RdIVHg2ZE=; b=QlwGOHE77Gmj7GZS2CnyKE1OXoaP/lB3tdU4QUGzCW6KtwWReNgwCU935RCVfaFKxl1Lq/ 0aJgI3IF9j1lC3u3TReCkMNzpCA+cTATwIFxyz7A5lbocfn2CGrl3qmGCOhxoNfrMVP6zN W+jVzI/gU7BKBGWAJAiEQavot7IJ7cI= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-387-yvl2-GesMsyNxXTKn1c7hg-1; Tue, 08 Jun 2021 11:25:31 -0400 X-MC-Unique: yvl2-GesMsyNxXTKn1c7hg-1 Received: by mail-wr1-f69.google.com with SMTP id m27-20020a056000025bb0290114d19822edso9586754wrz.21 for ; Tue, 08 Jun 2021 08:25:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Br1rr7QBQj6YS5zJZEG2ZfZMvTHbAXZUz7RdIVHg2ZE=; b=fBrUJBApPX77j4Z+MhVkcLnfyqNWreLexGZYK/d1oEako3ejo5IOeicziC9tVtJ9Oh eQ+APoUq9UaDtcZdYIxflt7dnMYvK64FoA14o0uojteUXKwgqV8VVYT9KKRPNq2QBHeq TpSNeMqHwPyagAlgyUrxZ7fnUjPKsfTVuOpWHyZReLeoNU18uBIyCPQawtUJeTlnKgrZ x/SloL9KNS9J1LH+VBLhCj0+5WSsGLE2tl5/eQBSxMVTvYZDS8atWPwtH+yYvkrfyBvv PSQ+3OpT+qqqy0n5UFP1/Cr3auwNpOZ8CxnKW3eXt+tNq5S2J9kYKGBT1BScB71n5YpZ 41xA== X-Gm-Message-State: AOAM530FdXp1DT7o4OCPZ8fHE35FPa5iYFnIh7x3CGm0qDtfmOvvXRiC umz0iALMtoTBjTjbulmdfELX1PTIT8BS3GSgFXFT6dc/lsm0CYwgG96HJz+sJNkobKesNeT/5bE LOGUG2pN4/1l/SfcAAExUd3C5 X-Received: by 2002:adf:f207:: with SMTP id p7mr17509463wro.275.1623165930408; Tue, 08 Jun 2021 08:25:30 -0700 (PDT) X-Received: by 2002:adf:f207:: with SMTP id p7mr17509455wro.275.1623165930303; Tue, 08 Jun 2021 08:25:30 -0700 (PDT) Received: from dresden.str.redhat.com ([2a02:908:1e46:160:b272:8083:d5:bc7d]) by smtp.gmail.com with ESMTPSA id b188sm4379485wmh.18.2021.06.08.08.25.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Jun 2021 08:25:30 -0700 (PDT) Subject: Re: [PATCH v2 4/7] fuse: Add dedicated filesystem context ops for submounts To: Greg Kurz , Miklos Szeredi Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, virtio-fs@redhat.com, Vivek Goyal References: <20210604161156.408496-1-groug@kaod.org> <20210604161156.408496-5-groug@kaod.org> From: Max Reitz Message-ID: <233b722a-4794-6905-f9d9-c0445ae24812@redhat.com> Date: Tue, 8 Jun 2021 17:25:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210604161156.408496-5-groug@kaod.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04.06.21 18:11, Greg Kurz wrote: > The creation of a submount is open-coded in fuse_dentry_automount(). > This brings a lot of complexity and we recently had to fix bugs > because we weren't setting SB_BORN or because we were unlocking > sb->s_umount before sb was fully configured. Most of these could > have been avoided by using the mount API instead of open-coding. > > Basically, this means coming up with a proper ->get_tree() > implementation for submounts and call vfs_get_tree(), or better > fc_mount(). > > The creation of the superblock for submounts is quite different from > the root mount. Especially, it doesn't require to allocate a FUSE > filesystem context, nor to parse parameters. > > Introduce a dedicated context ops for submounts to make this clear. > This is just a placeholder for now, fuse_get_tree_submount() will > be populated in a subsequent patch. > > Only visible change is that we stop allocating/freeing a useless FUSE > filesystem context with submounts. > > Signed-off-by: Greg Kurz > --- > fs/fuse/fuse_i.h | 5 +++++ > fs/fuse/inode.c | 16 ++++++++++++++++ > fs/fuse/virtio_fs.c | 3 +++ > 3 files changed, 24 insertions(+) Reviewed-by: Max Reitz