linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Yangtao Li <frank.li@vivo.com>,
	Naohiro Aota <naohiro.aota@wdc.com>,
	Johannes Thumshirn <jth@kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] zonefs: remove unnecessary kobject_del()
Date: Wed, 12 Apr 2023 17:04:16 +0900	[thread overview]
Message-ID: <9a92e541-cf98-4ac5-c181-4a6ba76d08f8@kernel.org> (raw)
In-Reply-To: <20230412031904.13739-1-frank.li@vivo.com>

On 4/12/23 12:19, Yangtao Li wrote:
> kobject_put() actually covers kobject removal automatically, which is
> single stage removal. So kill kobject_del() directly.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  fs/zonefs/sysfs.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/zonefs/sysfs.c b/fs/zonefs/sysfs.c
> index 8ccb65c2b419..a535bdea1097 100644
> --- a/fs/zonefs/sysfs.c
> +++ b/fs/zonefs/sysfs.c
> @@ -113,7 +113,6 @@ void zonefs_sysfs_unregister(struct super_block *sb)
>  	if (!sbi || !sbi->s_sysfs_registered)
>  		return;
>  
> -	kobject_del(&sbi->s_kobj);
>  	kobject_put(&sbi->s_kobj);
>  	wait_for_completion(&sbi->s_kobj_unregister);
>  }

What I am not sure about here is that if CONFIG_DEBUG_KOBJECT_RELEASE is
enabled, the kobj release is delayed, so the kobject will stay in sysfs
potentially after the umount() returns. Not exactly nice as that potentially
create races in user space... Not 100% sure though.

Greg ? Any thoughts on this ?

  reply	other threads:[~2023-04-12  8:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12  3:19 [PATCH] zonefs: remove unnecessary kobject_del() Yangtao Li
2023-04-12  8:04 ` Damien Le Moal [this message]
2023-04-12  8:11   ` Greg KH
2023-04-12  8:18     ` Damien Le Moal

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=9a92e541-cf98-4ac5-c181-4a6ba76d08f8@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=frank.li@vivo.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jth@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naohiro.aota@wdc.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;
as well as URLs for NNTP newsgroup(s).