From: Baokun Li <libaokun1@huawei.com>
To: Al Viro <viro@zeniv.linux.org.uk>
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>,
Baokun Li <libaokun1@huawei.com>
Subject: Re: [PATCH] erofs: fix lockdep false positives on initializing erofs_pseudo_mnt
Date: Thu, 7 Mar 2024 15:06:49 +0800 [thread overview]
Message-ID: <7e9746db-033e-64d0-a3d5-9d341c66cec7@huawei.com> (raw)
In-Reply-To: <20240307050717.GB538574@ZenIV>
On 2024/3/7 13:07, Al Viro wrote:
> On Thu, Mar 07, 2024 at 10:44:59AM +0800, Baokun Li wrote:
>
>> +static int erofs_anon_init_fs_context(struct fs_context *fc)
>> +{
>> + fc->ops = &erofs_anon_context_ops;
>> + return 0;
>> +}
>
> ITYM
> struct pseudo_fs_context *ctx = init_pseudo(fc, EROFS_SUPER_MAGIC);
> return ctx ? 0 : -ENOMEM;
>
> and to hell with erofs_anon_context_ops, along with its fill_super, calls
> of simple_fill_super(), etc. Unless I'm missing something, you are not
> even creating dentries here, let alone making them possible to look up.
Totally agree! It does streamline a lot!
>> +static void erofs_kill_pseudo_sb(struct super_block *sb)
>> +{
>> + kill_anon_super(sb);
>> +}
> *blink*
>
> What's wrong with simply using kill_anon_super as ->kill_sb?
Sure, I'll just use kill_anon_super().
>> +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
also use this helper function for code isolation.
>
>> if (!erofs_pseudo_mnt) {
>> - struct vfsmount *mnt = kern_mount(&erofs_fs_type);
>> + struct vfsmount *mnt = kern_mount(&erofs_anon_fs_type);
> ... since you are getting to it by direct reference to file_system_type
> anyway. Same unregistering, of course...
Thanks for having a look!
--
With Best Regards,
Baokun Li
.
next prev parent reply other threads:[~2024-03-07 7:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-07 2:44 [PATCH] erofs: fix lockdep false positives on initializing erofs_pseudo_mnt Baokun Li
2024-03-07 2:52 ` Gao Xiang
2024-03-07 3:31 ` Baokun Li
2024-03-07 3:41 ` Jingbo Xu
2024-03-07 4:18 ` Gao Xiang
2024-03-07 9:17 ` Christian Brauner
2024-03-07 9:20 ` Gao Xiang
2024-03-07 6:46 ` Baokun Li
2024-03-07 6:50 ` Gao Xiang
2024-03-07 5:07 ` Al Viro
2024-03-07 7:06 ` Baokun Li [this message]
2024-03-07 7:21 ` Al Viro
2024-03-07 7:43 ` Baokun Li
2024-03-07 8:46 ` Al Viro
2024-03-07 9:08 ` Baokun Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7e9746db-033e-64d0-a3d5-9d341c66cec7@huawei.com \
--to=libaokun1@huawei.com \
--cc=chao@kernel.org \
--cc=chengzhihao1@huawei.com \
--cc=houtao1@huawei.com \
--cc=huyue2@coolpad.com \
--cc=jefflexu@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=xiang@kernel.org \
--cc=yangerkun@huawei.com \
--cc=yukuai3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox