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. Signed-off-by: Viacheslav Dubeyko cc: Shardul Bankar cc: John Paul Adrian Glaubitz cc: Yangtao Li cc: linux-fsdevel@vger.kernel.org --- fs/hfsplus/btree.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fs/hfsplus/btree.c b/fs/hfsplus/btree.c index f1ed7c336593..80aa816ae1c0 100644 --- a/fs/hfsplus/btree.c +++ b/fs/hfsplus/btree.c @@ -146,8 +146,9 @@ struct hfs_bmap_ctx { * Returns the struct page pointer, or an ERR_PTR on failure. * Note: The caller is responsible for mapping/unmapping the returned page. */ -static struct page *hfs_bmap_get_map_page(struct hfs_bnode *node, struct hfs_bmap_ctx *ctx, - u32 byte_offset) +static struct page *hfs_bmap_get_map_page(struct hfs_bnode *node, + struct hfs_bmap_ctx *ctx, + u32 byte_offset) { u16 rec_idx, off16; unsigned int page_off; @@ -647,9 +648,12 @@ void hfs_bmap_free(struct hfs_bnode *node) res = hfs_bmap_clear_bit(node, nidx); if (res == -EINVAL) { - pr_crit("trying to free free bnode %u(%d)\n", - node->this, node->type); - } else if (!res) { + pr_crit("trying to free the freed bnode %u(%d)\n", + nidx, node->type); + } else if (res) { + pr_crit("fail to free bnode %u(%d)\n", + nidx, node->type); + } else { tree->free_nodes++; mark_inode_dirty(tree->inode); } -- 2.43.0