Re: [PATCH] xfs: fix temporary cursor leak in btree shift corruption paths

From: Carlos Maiolino

Date: Tue Nov 03 2026 - 05:10:56 EST


On Mon, 02 Nov 2026 23:01:41 +0800, jianyungao89@xxxxxxxxx wrote:
> In xfs_btree_lshift and xfs_btree_rshift, when XFS_IS_CORRUPT detects
> an invalid firstrec/lastrec result after xfs_btree_dup_cursor has
> successfully allocated a temporary cursor, the error path jumps to
> error0 which returns without freeing tcur. This leaks the cursor
> memory, the xfs_group reference, and the per-level buffer references
> held by the duplicated cursor. Jump to error1 instead, which calls
> xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR) to properly release all
> resources.
>
> [...]

Applied to for-next, thanks!

[1/1] xfs: fix temporary cursor leak in btree shift corruption paths
commit: 2bbca049deeb1699cafd966cb2793fee576ee409

Best regards,
--
Carlos Maiolino <cem@xxxxxxxxxx>