mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Heming Zhao <heming.zhao@suse.com>
To: Cen Zhang <zzzccc427@gmail.com>
Cc: mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com,
	akpm@linux-foundation.org, ghe@suse.com,
	ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
	baijiaju1990@gmail.com, jjzuming@gmail.com
Subject: Re: [PATCH] ocfs2: Publish the filecheck owner before adding sysfs attributes
Date: Mon, 12 Oct 2026 13:10:34 +0800	[thread overview]
Message-ID: <af295d6f-ed18-406d-adeb-f179ae3d0e74@suse.com> (raw)
In-Reply-To: <CAFRLqsVqawLcZK60Wt2GKszXCeeJj6WNEO09zwybxO+mkOUBaw@mail.gmail.com>

On 10/11/26 23:40, Cen Zhang wrote:
> Hi Heming,
> 
> Heming Zhao <heming.zhao@suse.com> 于2026年10月10日周六 15:38写道:
>>
>> setting to NULL is unnecessary, it becomes a harmless dangling pointer here.
>> Other code looks good to me.
>>
>> Thanks,
>> Heming
> 
> Thanks for reviewing this.
> 
> I checked the failure path again with the help of LLM, and I think clearing
> fs_fcheck is still needed on this baseline. If kobject_init_and_add()
> fails, the
> function puts the kobject and frees fcheck. Its caller in
> ocfs2_fill_super() then
> jumps to out_dismount, which calls ocfs2_dismount_volume() and, in turn,
> ocfs2_filecheck_remove_sysfs().
> 
> That last function returns early only when fs_fcheck is NULL. Leaving
> the dangling pointer would make it operate on the already-put kobject
> and access the freed fcheck in ocfs2_filecheck_sysfs_free().
> 
> I may still be missing something, but based on this path it seems the NULL
> assignment is still needed. Would you agree, or did I overlook a case where
> it is safe to leave it?
> 
> Thanks again for taking a look.
> 
> Best regards,
> Cen Zhang


Thanks for the info, I will add my reviewed-by tag.

- Heming

  reply	other threads:[~2026-10-12  5:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 10:04 Cen Zhang
2026-10-10  7:38 ` Heming Zhao
2026-10-11 15:40   ` Cen Zhang
2026-10-12  5:10     ` Heming Zhao [this message]
2026-10-12  5:13 ` Heming Zhao
2026-10-12  6:18 ` Joseph Qi

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=af295d6f-ed18-406d-adeb-f179ae3d0e74@suse.com \
    --to=heming.zhao@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=baijiaju1990@gmail.com \
    --cc=ghe@suse.com \
    --cc=jjzuming@gmail.com \
    --cc=jlbec@evilplan.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=ocfs2-devel@lists.linux.dev \
    --cc=zzzccc427@gmail.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

all inboxes | Powered by JetHome®