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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4E5C2C48BF6 for ; Thu, 7 Mar 2024 07:21:35 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linux.org.uk header.i=@linux.org.uk header.a=rsa-sha256 header.s=zeniv-20220401 header.b=I3u7exF8; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Tr1256ffBz3dX6 for ; Thu, 7 Mar 2024 18:21:33 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linux.org.uk header.i=@linux.org.uk header.a=rsa-sha256 header.s=zeniv-20220401 header.b=I3u7exF8; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=ftp.linux.org.uk (client-ip=2a03:a000:7:0:5054:ff:fe1c:15ff; helo=zeniv.linux.org.uk; envelope-from=viro@ftp.linux.org.uk; receiver=lists.ozlabs.org) Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Tr11v6rplz3c1g for ; Thu, 7 Mar 2024 18:21:22 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=8w8rejYB9PBmKB0DYtImdRxvM7rQ/tJG4QSkTuHYLXw=; b=I3u7exF8LYo6EnYsylcAmUSP+Z R0i7G9s8p9OgKJN6jlZEfFTBNB+jIFnUR2Lfe+LMXnV1DiqReY6K+WzE/3TFxRtOWELmj2CYfDslt 2gyw22XfQUJ+JtsoAg63qUO7FmSMcl6Hp+1CuLtV1n5KaUrc+IPZKYeSMBrnW1ra+nuJY8k1VSx4Z lDGuSBayME4GraArPrhR2obfaG+oUcwaJU4FKq0Rl2Q8b68HSjbdBfK3y267PwUK24ePKDf0osb9T LVY5we2/bTF4Tp3weeVUVNxuH3EGW+4c7PmAi/fC0hYmQrR11bKHhVw1fb/O0IRUGsioIkaRPhQzt Z+CFRwkA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1ri841-003FW0-06; Thu, 07 Mar 2024 07:21:13 +0000 Date: Thu, 7 Mar 2024 07:21:12 +0000 From: Al Viro To: Baokun Li Subject: Re: [PATCH] erofs: fix lockdep false positives on initializing erofs_pseudo_mnt Message-ID: <20240307072112.GC538574@ZenIV> References: <20240307024459.883044-1-libaokun1@huawei.com> <20240307050717.GB538574@ZenIV> <7e9746db-033e-64d0-a3d5-9d341c66cec7@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7e9746db-033e-64d0-a3d5-9d341c66cec7@huawei.com> X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: chengzhihao1@huawei.com, yangerkun@huawei.com, linux-kernel@vger.kernel.org, huyue2@coolpad.com, yukuai3@huawei.com, linux-erofs@lists.ozlabs.org Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On Thu, Mar 07, 2024 at 03:06:49PM +0800, Baokun Li wrote: > > > +int erofs_anon_register_fs(void) > > > +{ > > > + return register_filesystem(&erofs_anon_fs_type); > > > +} > > What for? The only thing it gives you is an ability to look it up by > > name. Which is completely pointless, IMO, > The helper function here is to avoid extern erofs_anon_fs_type(), because > we define it in fscache.c, but also use it in super.c. Moreover, we don't > need > to register it when CONFIG_EROFS_FS_ONDEMAND is not enabled, so we You don't need to register it at all. The one and only effect of register_filesystem() is making file_system_type instance visible to get_fs_type() (and making it show up in /proc/filesystems). That's it. If you want to have it looked up by name (e.g. for userland mounts), you need to register. If not, you do not need to do that. Note that kern_mount() take a pointer to struct file_system_type, not its (string) name. So all you get from registration is an extra line in /proc/filesystems. What's the point? From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 679F21FDD for ; Thu, 7 Mar 2024 07:21:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709796105; cv=none; b=DqZhU/yPvPCsc0miWFOJoaVNMKAxQditxJeEKR0f61Na2mVyPzg/DKzZKQIixiAc1crXKB7gxUU/s+EL1YWae06oHcbTpU0LLf1ayl2YafVD8sf+Cip7dypBlTx5Ho3ZMuVVTnR69a7MJ9ZgwRcD8j5PXHyphqTN0GqksofzvOg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709796105; c=relaxed/simple; bh=MqVBXUoVntZHD125v6N35fVG05A3BHyjL4XSvBEiedY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IG/rRSMO3XgoQ68XxGH9qsvp+Pc8zGMhQrk1inOVBZ4dgl5WxpOHKxuNASVY0AP1q/G0DwWQg3RiNhIZIdFfqyhudnu47Zg9j1eGmOE4UWgkBQuj+TNq0mKlXa0uq7BlU9t5+3mq9DXAOmd9iMH6RugkLlYRrrOUZteqDYoHFnI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=I3u7exF8; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="I3u7exF8" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=8w8rejYB9PBmKB0DYtImdRxvM7rQ/tJG4QSkTuHYLXw=; b=I3u7exF8LYo6EnYsylcAmUSP+Z R0i7G9s8p9OgKJN6jlZEfFTBNB+jIFnUR2Lfe+LMXnV1DiqReY6K+WzE/3TFxRtOWELmj2CYfDslt 2gyw22XfQUJ+JtsoAg63qUO7FmSMcl6Hp+1CuLtV1n5KaUrc+IPZKYeSMBrnW1ra+nuJY8k1VSx4Z lDGuSBayME4GraArPrhR2obfaG+oUcwaJU4FKq0Rl2Q8b68HSjbdBfK3y267PwUK24ePKDf0osb9T LVY5we2/bTF4Tp3weeVUVNxuH3EGW+4c7PmAi/fC0hYmQrR11bKHhVw1fb/O0IRUGsioIkaRPhQzt Z+CFRwkA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1ri841-003FW0-06; Thu, 07 Mar 2024 07:21:13 +0000 Date: Thu, 7 Mar 2024 07:21:12 +0000 From: Al Viro To: Baokun Li Cc: linux-erofs@lists.ozlabs.org, xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, linux-kernel@vger.kernel.org, yangerkun@huawei.com, houtao1@huawei.com, yukuai3@huawei.com, chengzhihao1@huawei.com Subject: Re: [PATCH] erofs: fix lockdep false positives on initializing erofs_pseudo_mnt Message-ID: <20240307072112.GC538574@ZenIV> References: <20240307024459.883044-1-libaokun1@huawei.com> <20240307050717.GB538574@ZenIV> <7e9746db-033e-64d0-a3d5-9d341c66cec7@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7e9746db-033e-64d0-a3d5-9d341c66cec7@huawei.com> Sender: Al Viro On Thu, Mar 07, 2024 at 03:06:49PM +0800, Baokun Li wrote: > > > +int erofs_anon_register_fs(void) > > > +{ > > > + return register_filesystem(&erofs_anon_fs_type); > > > +} > > What for? The only thing it gives you is an ability to look it up by > > name. Which is completely pointless, IMO, > The helper function here is to avoid extern erofs_anon_fs_type(), because > we define it in fscache.c, but also use it in super.c. Moreover, we don't > need > to register it when CONFIG_EROFS_FS_ONDEMAND is not enabled, so we You don't need to register it at all. The one and only effect of register_filesystem() is making file_system_type instance visible to get_fs_type() (and making it show up in /proc/filesystems). That's it. If you want to have it looked up by name (e.g. for userland mounts), you need to register. If not, you do not need to do that. Note that kern_mount() take a pointer to struct file_system_type, not its (string) name. So all you get from registration is an extra line in /proc/filesystems. What's the point?