Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp395568lqi; Wed, 6 Mar 2024 23:43:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUbWOMpjDq49GEtWgJJr+0yTl97upV1kwyWDGtw3lBgNxV+NZiVJwsffCQh9neusId140Ue+n8pG9qVx9U+j3O1JDf4a7RXlU0r5BxixQ== X-Google-Smtp-Source: AGHT+IG/nuylrbWqgNqJbQTbbGcB/PutGA3+VYIDHYIwtkCS7xKmpiqfbjo7+HkXhM2daOelful5 X-Received: by 2002:a05:620a:5d90:b0:788:31b3:8270 with SMTP id xx16-20020a05620a5d9000b0078831b38270mr6952502qkn.33.1709797436425; Wed, 06 Mar 2024 23:43:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709797436; cv=pass; d=google.com; s=arc-20160816; b=SerA+V5BOkcCyoaSpBvTIE/mFsspg06yKehkrnV/nE/S3REXFdJrhFCKLKfM9AZtdv 5npEgfFlKo5z2B6wzR77aNjguZ1HZBEU4fwXXJzoSIENf7oNBUT/f+j+KijDru/XYokq J48tLKekA+KaaU7sj6ZZtBsLmOzMqVyYDrDBEUD9u3ya5gkrm/TTbAymGrCDFZH0iLD5 85qaQFq7kjZopX4RyifgEnMFfoWeK6VATfHCT57gNCa7LCX/iNXqwKvyZ0WnJLiSN4Q1 Gp1M0VA/hN8CTtvyE0jtRggkbIDFrafSZdRdxW5+9CfpQsLllBiFH2CtGyO6uqgw8Sxv /VyA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=Sozi5j/4xKm6chbXSJ4acWxVe6lWx+If+vi/FDm97/Y=; fh=5IVOnG28YEOsk9WiS8YbVdIKKJPOd5eKRm1+INKfiKI=; b=oBRM7vxJVCEt5QxHxWnscjr6QoR6/OpTTPV+XtIo5G2L5DTknYtiT4wkGCvfrOnDSY Ce0XnVE526GhiIa3+x6z9Rs/qFYRl3uZKRIMuNlO2zG3S4gP7AEvHbCtohfABgiwE+Rt sE+bF+mKIieWmi6iWo/HyARFDtqXrO8gxXgAFLMrIYFFrAxt8Xw3Ru8JArV9fCfGMgVO 67HHqe8IY11xu26eOpRwH0GUQ+mGvap7nrDEMuyNYsMtIgWTlBShSOinHMrqo/dgDhnn /ERbhznVDBksupr7NHYoISOt1nIcbrEUs/qJxM6wUV/Jj4w0+CXS/PHCpseNtqWKZUaz gDdg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-95074-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95074-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id b14-20020a05620a088e00b007881e4bc513si10341383qka.125.2024.03.06.23.43.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 23:43:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95074-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-95074-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95074-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 289221C2159F for ; Thu, 7 Mar 2024 07:43:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 141E96311C; Thu, 7 Mar 2024 07:43:51 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (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 E1FCF38DEF for ; Thu, 7 Mar 2024 07:43:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709797430; cv=none; b=kD0Vj7RIj+l+4ejU2JtrIvlE/oAgqBAZSNOfhXMw5cCDnYCIaG5551WZwzhok1XOq2DptGLx6VOqoG4kvo9cDCcSeMXeZBH3bn84hZh97L/e8xIVUySfaErry69Znc6cDZj92wFCh7ydCU/aCU8mNKo91tXOsZWYzDQlJE1BB2c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709797430; c=relaxed/simple; bh=LVAe2E6e0Oz/NDfDpFiSTBjN3xsQ02++UCJW5rUkH+U=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=ClAcaUEYE+XjTtl/PpJdTTFNWlg0PJKcZwqvsp+3noTMpSknHeNF7TTBfhhmrzY6m0ch4WCgK7LBy4DnVroyACTlgjIRD95kfZZBM0M/yDTLDyqS7HdZS2dk1fKfOV0jnd3EkbwoIm66cRSsAbgcC7rU07SEQuMbOtPMgNDRUWk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Tr1T261TgzwPHK; Thu, 7 Mar 2024 15:41:26 +0800 (CST) Received: from dggpeml500021.china.huawei.com (unknown [7.185.36.21]) by mail.maildlp.com (Postfix) with ESMTPS id 4EC5D140410; Thu, 7 Mar 2024 15:43:45 +0800 (CST) Received: from [10.174.177.174] (10.174.177.174) by dggpeml500021.china.huawei.com (7.185.36.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 7 Mar 2024 15:43:44 +0800 Message-ID: Date: Thu, 7 Mar 2024 15:43:44 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: [PATCH] erofs: fix lockdep false positives on initializing erofs_pseudo_mnt Content-Language: en-US To: Al Viro CC: , , , , , , , , , , Baokun Li References: <20240307024459.883044-1-libaokun1@huawei.com> <20240307050717.GB538574@ZenIV> <7e9746db-033e-64d0-a3d5-9d341c66cec7@huawei.com> <20240307072112.GC538574@ZenIV> From: Baokun Li In-Reply-To: <20240307072112.GC538574@ZenIV> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500021.china.huawei.com (7.185.36.21) On 2024/3/7 15:21, Al Viro wrote: > 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? It's dawning on me, thank you so much for explaining! ღ( ´・ᴗ・` ) -- With Best Regards, Baokun Li .