]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
hfsplus: fix logic of alloc/free b-tree node
authorViacheslav Dubeyko <slava@dubeyko.com>
Fri, 3 Apr 2026 23:05:54 +0000 (16:05 -0700)
committerViacheslav Dubeyko <slava@dubeyko.com>
Wed, 8 Apr 2026 21:23:29 +0000 (14:23 -0700)
commit63584d76765bb3e212f70c4c3951ea785fabef1b
tree3592fbcc35b7acc363fa9ff9ffb91a00873a55dc
parentcd3901f4c0348da84f33b6b6e3e8e9aa7e441d01
hfsplus: fix logic of alloc/free b-tree node

The hfs_bmap_alloc() and hfs_bmap_free() modify
the b-tree's counters and nodes' bitmap of b-tree.
However, hfs_btree_write() synchronizes the state of
in-core b-tree's counters and node's bitmap with
b-tree's descriptor in header node. Postponing this
synchronization could result in inconsistent state of
file system volume. This patch adds calling of
hfs_btree_write() in hfs_bmap_alloc() and hfs_bmap_free()
methods.

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-4-slava@dubeyko.com
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
fs/hfsplus/btree.c