Commit d250bdf5 authored by Yang Erkun's avatar Yang Erkun Committed by Theodore Ts'o
Browse files

ext4: fix iloc.bh leak in ext4_xattr_inode_update_ref



The error branch for ext4_xattr_inode_update_ref forget to release the
refcount for iloc.bh. Find this when review code.

Fixes: 57295e83 ("ext4: guard against EA inode refcount underflow in xattr update")
Signed-off-by: default avatarYang Erkun <yangerkun@huawei.com>
Reviewed-by: default avatarBaokun Li <libaokun1@huawei.com>
Reviewed-by: default avatarZhang Yi <yi.zhang@huawei.com>
Link: https://patch.msgid.link/20251213055706.3417529-1-yangerkun@huawei.com


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
parent 0ef7ef42
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1037,6 +1037,7 @@ static int ext4_xattr_inode_update_ref(handle_t *handle, struct inode *ea_inode,
		ext4_error_inode(ea_inode, __func__, __LINE__, 0,
			"EA inode %lu ref wraparound: ref_count=%lld ref_change=%d",
			ea_inode->i_ino, ref_count, ref_change);
		brelse(iloc.bh);
		ret = -EFSCORRUPTED;
		goto out;
	}