[ Sasha's backport helper bot ]
Hi,
Summary of potential issues: ℹ️ This is part 06/29 of a series ⚠️ Found follow-up fixes in mainline
The upstream commit SHA1 provided is correct: 7dfee17b13e5024c5c0ab1911859ded4182de3e5
WARNING: Author mismatch between patch and upstream commit: Backport author: Leah Rumancikleah.rumancik@gmail.com Commit author: Dave Chinnerdchinner@redhat.com
Status in newer kernel trees: 6.13.y | Present (exact SHA1) 6.12.y | Present (exact SHA1) 6.6.y | Present (exact SHA1)
Found fixes commits: 2bed0d82c2f7 xfs: fix bounds check in xfs_defer_agfl_block()
Note: The patch differs from the upstream commit: --- 1: 7dfee17b13e50 ! 1: 0de6be42d2941 xfs: validate block number being freed before adding to xefi @@ Metadata ## Commit message ## xfs: validate block number being freed before adding to xefi
+ [ Upstream commit 7dfee17b13e5024c5c0ab1911859ded4182de3e5 ] + Bad things happen in defered extent freeing operations if it is passed a bad block number in the xefi. This can come from a bogus agno/agbno pair from deferred agfl freeing, or just a bad fsbno @@ Commit message Reviewed-by: Christoph Hellwig hch@lst.de Reviewed-by: Darrick J. Wong djwong@kernel.org Signed-off-by: Dave Chinner david@fromorbit.com + Signed-off-by: Leah Rumancik leah.rumancik@gmail.com + Acked-by: "Darrick J. Wong" djwong@kernel.org
## fs/xfs/libxfs/xfs_ag.c ## @@ fs/xfs/libxfs/xfs_ag.c: xfs_ag_shrink_space( @@ fs/xfs/libxfs/xfs_alloc.c: xfs_defer_agfl_block( + trace_xfs_agfl_free_defer(mp, agno, 0, agbno, 1);
- xfs_extent_free_get_group(mp, xefi); xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_AGFL_FREE, &xefi->xefi_list); + return 0; } @@ fs/xfs/libxfs/xfs_alloc.c: __xfs_free_extent_later( GFP_KERNEL | __GFP_NOFAIL); xefi->xefi_startblock = bno; @@ fs/xfs/libxfs/xfs_alloc.c: __xfs_free_extent_later( - - xfs_extent_free_get_group(mp, xefi); + XFS_FSB_TO_AGNO(tp->t_mountp, bno), 0, + XFS_FSB_TO_AGBNO(tp->t_mountp, bno), len); xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_FREE, &xefi->xefi_list); + return 0; } @@ fs/xfs/libxfs/xfs_alloc.h: xfs_buf_to_agfl_bno( xfs_filblks_t len, const struct xfs_owner_info *oinfo, bool skip_discard);
-@@ fs/xfs/libxfs/xfs_alloc.h: void xfs_extent_free_get_group(struct xfs_mount *mp, +@@ fs/xfs/libxfs/xfs_alloc.h: struct xfs_extent_free_item { #define XFS_EFI_ATTR_FORK (1U << 1) /* freeing attr fork block */ #define XFS_EFI_BMBT_BLOCK (1U << 2) /* freeing bmap btree block */
---
NOTE: These results are for this patch alone. Full series testing will be performed when all parts are received.
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.1.y | Success | Success |