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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 019A6C48BCF for ; Wed, 9 Jun 2021 07:46:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DDA9361361 for ; Wed, 9 Jun 2021 07:46:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236809AbhFIHr4 convert rfc822-to-8bit (ORCPT ); Wed, 9 Jun 2021 03:47:56 -0400 Received: from us-smtp-delivery-44.mimecast.com ([207.211.30.44]:29199 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236375AbhFIHry (ORCPT ); Wed, 9 Jun 2021 03:47:54 -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-143-8MgHxSRfNGK8NOd496-1zQ-1; Wed, 09 Jun 2021 03:45:55 -0400 X-MC-Unique: 8MgHxSRfNGK8NOd496-1zQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9FCD78049C5; Wed, 9 Jun 2021 07:45:54 +0000 (UTC) Received: from bahia.lan (ovpn-112-166.ams2.redhat.com [10.36.112.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id E51A55C1C2; Wed, 9 Jun 2021 07:45:48 +0000 (UTC) Date: Wed, 9 Jun 2021 09:45:47 +0200 From: Greg Kurz To: Max Reitz Cc: Miklos Szeredi , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, virtio-fs@redhat.com, Vivek Goyal Subject: Re: [PATCH v2 6/7] fuse: Switch to fc_mount() for submounts Message-ID: <20210609094547.222fc420@bahia.lan> In-Reply-To: <0d3b4dfb-2474-2200-80d1-39dcbf8f626e@redhat.com> References: <20210604161156.408496-1-groug@kaod.org> <20210604161156.408496-7-groug@kaod.org> <0d3b4dfb-2474-2200-80d1-39dcbf8f626e@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kaod.org Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 8 Jun 2021 17:51:03 +0200 Max Reitz wrote: > On 04.06.21 18:11, Greg Kurz wrote: > > fc_mount() already handles the vfs_get_tree(), sb->s_umount > > unlocking and vfs_create_mount() sequence. Using it greatly > > simplifies fuse_dentry_automount(). > > > > Signed-off-by: Greg Kurz > > --- > > fs/fuse/dir.c | 26 +++++--------------------- > > 1 file changed, 5 insertions(+), 21 deletions(-) > > > > diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c > > index b88e5785a3dd..fc9eddf7f9b2 100644 > > --- a/fs/fuse/dir.c > > +++ b/fs/fuse/dir.c > > @@ -311,38 +311,22 @@ static struct vfsmount *fuse_dentry_automount(struct path *path) > > struct fs_context *fsc; > > struct vfsmount *mnt; > > struct fuse_inode *mp_fi = get_fuse_inode(d_inode(path->dentry)); > > - int err; > > > > fsc = fs_context_for_submount(path->mnt->mnt_sb->s_type, path->dentry); > > - if (IS_ERR(fsc)) { > > - err = PTR_ERR(fsc); > > - goto out; > > - } > > + if (IS_ERR(fsc)) > > + return (struct vfsmount *) fsc; > > I think ERR_CAST(fsc) would be nicer. > Indeed. I'll fix that if I need to repost. > Apart from that: > > Reviewed-by: Max Reitz >