From: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
To: "glaubitz@physik.fu-berlin.de" <glaubitz@physik.fu-berlin.de>,
"shardulsb08@gmail.com" <shardulsb08@gmail.com>,
"slava@dubeyko.com" <slava@dubeyko.com>,
"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"frank.li@vivo.com" <frank.li@vivo.com>
Cc: "shardul.b@mpiricsoftware.com" <shardul.b@mpiricsoftware.com>,
"jack@suse.cz" <jack@suse.cz>,
"janak@mpiricsoftware.com" <janak@mpiricsoftware.com>,
"brauner@kernel.org" <brauner@kernel.org>
Subject: Re: [PATCH] hfsplus: avoid double unload_nls() on mount failure
Date: Thu, 5 Feb 2026 23:08:16 +0000 [thread overview]
Message-ID: <e43a62e755600326b94ca2be3aa035bdf75c9594.camel@ibm.com> (raw)
In-Reply-To: <20260204170440.1337261-1-shardul.b@mpiricsoftware.com>
On Wed, 2026-02-04 at 22:34 +0530, Shardul Bankar wrote:
> The recent commit "hfsplus: ensure sb->s_fs_info is always cleaned up"
> [1] introduced a custom ->kill_sb() handler (hfsplus_kill_super) that
> cleans up the s_fs_info structure (including the NLS table) on
> superblock destruction.
>
> However, the error handling path in hfsplus_fill_super() still calls
> unload_nls() before returning an error. Since the VFS layer calls
> ->kill_sb() when fill_super fails, this results in unload_nls() being
> called twice for the same sbi->nls pointer: once in hfsplus_fill_super()
> and again in hfsplus_kill_super() (via delayed_free).
>
> Remove the explicit unload_nls() call from the error path in
> hfsplus_fill_super() to rely solely on the cleanup in ->kill_sb().
>
> [1] https://urldefense.proofpoint.com/v2/url?u=https-3A__lore.kernel.org_r_20251201222843.82310-2D3-2Dmehdi.benhadjkhelifa-40gmail.com_&d=DwIDAg&c=BSDicqBQBDjDI9RkVyTcHQ&r=q5bIm4AXMzc8NJu1_RGmnQ2fMWKq4Y4RAkElvUgSs00&m=nIRFVBbXkO1U_YAsBLT6Dhsz-kvNCbzVyuUUFiyzQfAIX7tfj6zSpbH_g8v0DJbV&s=6wZhKrQgBTT7arelKg7fe1Gz59hLAYxtnzEEduFDLGs&e=
>
> Reported-by: Al Viro <viro@zeniv.linux.org.uk>
> Link: https://urldefense.proofpoint.com/v2/url?u=https-3A__lore.kernel.org_r_20260203043806.GF3183987-40ZenIV_&d=DwIDAg&c=BSDicqBQBDjDI9RkVyTcHQ&r=q5bIm4AXMzc8NJu1_RGmnQ2fMWKq4Y4RAkElvUgSs00&m=nIRFVBbXkO1U_YAsBLT6Dhsz-kvNCbzVyuUUFiyzQfAIX7tfj6zSpbH_g8v0DJbV&s=kDiSIqwoTkI8MkVogNxafY0dp80MuZk0t-w_E4I40QQ&e=
> Signed-off-by: Shardul Bankar <shardul.b@mpiricsoftware.com>
> ---
> fs/hfsplus/super.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
> index 829c8ac2639c..5ba26404f504 100644
> --- a/fs/hfsplus/super.c
> +++ b/fs/hfsplus/super.c
> @@ -646,7 +646,6 @@ static int hfsplus_fill_super(struct super_block *sb, struct fs_context *fc)
> kfree(sbi->s_vhdr_buf);
> kfree(sbi->s_backup_vhdr_buf);
> out_unload_nls:
> - unload_nls(sbi->nls);
> unload_nls(nls);
> return err;
> }
Makes sense and looks good.
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
Thanks,
Slava.
next prev parent reply other threads:[~2026-02-05 23:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-01 13:12 [PATCH v2] hfsplus: fix s_fs_info leak on mount setup failure Shardul Bankar
2026-02-02 17:53 ` Viacheslav Dubeyko
2026-02-03 4:38 ` Al Viro
2026-02-03 23:35 ` Viacheslav Dubeyko
2026-02-04 4:19 ` Shardul Bankar
2026-02-04 17:04 ` [PATCH] hfsplus: avoid double unload_nls() on mount failure Shardul Bankar
2026-02-05 23:08 ` Viacheslav Dubeyko [this message]
2026-02-04 17:30 ` [PATCH v2] hfsplus: fix s_fs_info leak on mount setup failure Al Viro
2026-02-04 17:40 ` Al Viro
2026-02-04 17:52 ` Al Viro
2026-02-04 18:25 ` Al Viro
2026-02-04 23:04 ` Viacheslav Dubeyko
2026-02-06 22:22 ` Viacheslav Dubeyko
2026-02-11 2:03 ` Al Viro
2026-02-11 23:49 ` Viacheslav Dubeyko
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=e43a62e755600326b94ca2be3aa035bdf75c9594.camel@ibm.com \
--to=slava.dubeyko@ibm.com \
--cc=brauner@kernel.org \
--cc=frank.li@vivo.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=jack@suse.cz \
--cc=janak@mpiricsoftware.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shardul.b@mpiricsoftware.com \
--cc=shardulsb08@gmail.com \
--cc=slava@dubeyko.com \
--cc=viro@zeniv.linux.org.uk \
/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®