[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260204170440.1337261-1-shardul.b@mpiricsoftware.com>
Date: Wed, 4 Feb 2026 22:34:40 +0530
From: Shardul Bankar <shardulsb08@...il.com>
To: slava@...eyko.com,
viro@...iv.linux.org.uk,
glaubitz@...sik.fu-berlin.de,
frank.li@...o.com,
linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: jack@...e.cz,
brauner@...nel.org,
janak@...ricsoftware.com,
shardulsb08@...il.com,
Shardul Bankar <shardul.b@...ricsoftware.com>
Subject: [PATCH] hfsplus: avoid double unload_nls() on mount failure
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://lore.kernel.org/r/20251201222843.82310-3-mehdi.benhadjkhelifa@gmail.com/
Reported-by: Al Viro <viro@...iv.linux.org.uk>
Link: https://lore.kernel.org/r/20260203043806.GF3183987@ZenIV/
Signed-off-by: Shardul Bankar <shardul.b@...ricsoftware.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;
}
--
2.34.1
Powered by blists - more mailing lists