public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Baokun Li <libaokun1@huawei.com>
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
Date: Thu, 7 Mar 2024 05:07:17 +0000	[thread overview]
Message-ID: <20240307050717.GB538574@ZenIV> (raw)
In-Reply-To: <20240307024459.883044-1-libaokun1@huawei.com>

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.

> +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?

> +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,

>  	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...

  parent reply	other threads:[~2024-03-07  5:07 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 [this message]
2024-03-07  7:06   ` Baokun Li
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=20240307050717.GB538574@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=chao@kernel.org \
    --cc=chengzhihao1@huawei.com \
    --cc=houtao1@huawei.com \
    --cc=huyue2@coolpad.com \
    --cc=jefflexu@linux.alibaba.com \
    --cc=libaokun1@huawei.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --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