Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

hfsplus: fix error processing issue in hfs_bmap_free()

Currently, we check only -EINVAL error code in hfs_bmap_free()
after calling the hfs_bmap_clear_bit(). It means that other
error codes will be silently ignored. This patch adds the checking
of all other error codes.

cc: Shardul Bankar <shardul.b@mpiricsoftware.com>
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-3-slava@dubeyko.com
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>

+9 -5
+9 -5
fs/hfsplus/btree.c
··· 146 146 * Returns the struct page pointer, or an ERR_PTR on failure. 147 147 * Note: The caller is responsible for mapping/unmapping the returned page. 148 148 */ 149 - static struct page *hfs_bmap_get_map_page(struct hfs_bnode *node, struct hfs_bmap_ctx *ctx, 150 - u32 byte_offset) 149 + static struct page *hfs_bmap_get_map_page(struct hfs_bnode *node, 150 + struct hfs_bmap_ctx *ctx, 151 + u32 byte_offset) 151 152 { 152 153 u16 rec_idx, off16; 153 154 unsigned int page_off; ··· 648 647 649 648 res = hfs_bmap_clear_bit(node, nidx); 650 649 if (res == -EINVAL) { 651 - pr_crit("trying to free free bnode %u(%d)\n", 652 - node->this, node->type); 653 - } else if (!res) { 650 + pr_crit("trying to free the freed bnode %u(%d)\n", 651 + nidx, node->type); 652 + } else if (res) { 653 + pr_crit("fail to free bnode %u(%d)\n", 654 + nidx, node->type); 655 + } else { 654 656 tree->free_nodes++; 655 657 mark_inode_dirty(tree->inode); 656 658 }