lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7e9746db-033e-64d0-a3d5-9d341c66cec7@huawei.com>
Date: Thu, 7 Mar 2024 15:06:49 +0800
From: Baokun Li <libaokun1@...wei.com>
To: Al Viro <viro@...iv.linux.org.uk>
CC: <linux-erofs@...ts.ozlabs.org>, <xiang@...nel.org>, <chao@...nel.org>,
	<huyue2@...lpad.com>, <jefflexu@...ux.alibaba.com>,
	<linux-kernel@...r.kernel.org>, <yangerkun@...wei.com>, <houtao1@...wei.com>,
	<yukuai3@...wei.com>, <chengzhihao1@...wei.com>, Baokun Li
	<libaokun1@...wei.com>
Subject: Re: [PATCH] erofs: fix lockdep false positives on initializing
 erofs_pseudo_mnt

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
.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ