]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
hfsplus: rework logic of map nodes creation in xattr b-tree
authorViacheslav Dubeyko <slava@dubeyko.com>
Fri, 3 Apr 2026 23:05:55 +0000 (16:05 -0700)
committerViacheslav Dubeyko <slava@dubeyko.com>
Wed, 8 Apr 2026 21:23:29 +0000 (14:23 -0700)
commit732af3aa6337fd56025c0548a9e54d6231052144
tree3fe7d66379f4b18188acf5870b022aea82a5b8af
parent63584d76765bb3e212f70c4c3951ea785fabef1b
hfsplus: rework logic of map nodes creation in xattr b-tree

In hfsplus_init_header_node() when node_count > 63488
(header bitmap capacity), the code calculates map_nodes,
subtracts them from free_nodes, and marks their positions
used in the bitmap. However, it doesn't write the actual
map node structure (type, record offsets, bitmap) for
those physical positions, only node 0 is written.

This patch reworks hfsplus_create_attributes_file()
logic by introducing a specialized method of
hfsplus_init_map_node() and writing the allocated
map b-tree's nodes by means of
hfsplus_write_attributes_file_node() method.

cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
cc: Yangtao Li <frank.li@vivo.com>
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Link: https://lore.kernel.org/r/20260403230556.614171-5-slava@dubeyko.com
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
fs/hfsplus/xattr.c
include/linux/hfs_common.h