linux/fs/hfsplus
Shardul Bankar ebebb04bae 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@zeniv.linux.org.uk>
Link: https://lore.kernel.org/r/20260203043806.GF3183987@ZenIV/
Signed-off-by: Shardul Bankar <shardul.b@mpiricsoftware.com>
Link: https://lore.kernel.org/r/20260204170440.1337261-1-shardul.b@mpiricsoftware.com
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
2026-02-06 15:20:00 -08:00
..
.kunitconfig hfsplus: introduce KUnit tests for HFS+ string operations 2025-11-24 16:12:51 -08:00
attributes.c hfsplus: fix generic/037 xfstests failure 2026-01-19 19:46:21 -08:00
bfind.c hfs/hfsplus: prevent getting negative values of offset/length 2025-11-13 15:02:52 -08:00
bitmap.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
bnode.c hfsplus: return error when node already exists in hfs_bnode_create 2026-01-06 12:40:49 -08:00
brec.c hfs/hfsplus: prevent getting negative values of offset/length 2025-11-13 15:02:52 -08:00
btree.c hfs/hfsplus: prevent getting negative values of offset/length 2025-11-13 15:02:52 -08:00
catalog.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
dir.c hfsplus: fix volume corruption issue for generic/480 2025-12-15 15:19:19 -08:00
extents.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
hfsplus_fs.h hfsplus: fix generic/037 xfstests failure 2026-01-19 19:46:21 -08:00
hfsplus_raw.h hfs/hfsplus: move on-disk layout declarations into hfs_common.h 2025-11-25 15:16:03 -08:00
inode.c hfsplus: fix warning issue in inode.c 2026-01-29 11:59:01 -08:00
ioctl.c vfs: rename parent_ino to d_parent_ino and make it use RCU 2024-06-27 18:34:21 +02:00
Kconfig hfsplus: introduce KUnit tests for HFS+ string operations 2025-11-24 16:12:51 -08:00
Makefile hfsplus: introduce KUnit tests for HFS+ string operations 2025-11-24 16:12:51 -08:00
options.c fs: inline current_umask() and move it to fs_struct.h 2025-11-05 22:51:23 +01:00
part_tbl.c fs/hfsplus: Use the enum req_op and blk_opf_t types 2022-07-14 12:14:32 -06:00
super.c hfsplus: avoid double unload_nls() on mount failure 2026-02-06 15:20:00 -08:00
tables.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
unicode.c hfsplus: introduce KUnit tests for HFS+ string operations 2025-11-24 16:12:51 -08:00
unicode_test.c hfsplus: introduce KUnit tests for HFS+ string operations 2025-11-24 16:12:51 -08:00
wrapper.c hfsplus: use bdev_rw_virt in hfsplus_submit_bio 2025-05-07 07:31:08 -06:00
xattr.c hfsplus: fix generic/062 xfstests failure 2026-01-28 14:53:15 -08:00
xattr.h hfsplus: move hfsplus_xattr_handlers to .rodata 2023-10-09 16:24:19 +02:00
xattr_security.c fs: port xattr to mnt_idmap 2023-01-19 09:24:28 +01:00
xattr_trusted.c fs: port xattr to mnt_idmap 2023-01-19 09:24:28 +01:00
xattr_user.c fs: port xattr to mnt_idmap 2023-01-19 09:24:28 +01:00