mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 04:21:09 -04:00
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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user