From b942c6919ac39870f8327d3123a2912d96e7e617 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 24 Sep 2026 11:57:10 +0200 Subject: [PATCH] xfs: calculate end_fsb later in xfs_zoned_fill_srcmap xfs_trim_extent doesn't need the updated end_fsb as it already is limited by the smap range. Move the end_fsb calculation later to prepare additional reasons that could reduce the smap range. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Carlos Maiolino --- fs/xfs/xfs_iomap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index a43769b506f8..329c745e3120 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c @@ -1613,8 +1613,8 @@ xfs_zoned_fill_srcmap( /* * There is a data fork mapping, only map until the end of it. */ - *end_fsb = min(*end_fsb, smap.br_startoff + smap.br_blockcount); xfs_trim_extent(&smap, offset_fsb, *end_fsb - offset_fsb); + *end_fsb = min(*end_fsb, smap.br_startoff + smap.br_blockcount); return xfs_bmbt_to_iomap(ip, srcmap, &smap, flags, 0, xfs_iomap_inode_sequence(ip, 0)); }