]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: fix logdev fsmap query result filtering
authorDarrick J. Wong <djwong@kernel.org>
Wed, 11 Jun 2025 21:01:09 +0000 (14:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:07:19 +0000 (11:07 +0100)
commit1504e39549c108c1d41260a65ebcb8b790b89f99
tree1a5e25b325ab6cc139995dbe30249f61cd7292a1
parent35d680817f3a5f3c25f746ef74587877ad222572
xfs: fix logdev fsmap query result filtering

[ Upstream commit a949a1c2a198e048630a8b0741a99b85a5d88136 ]

The external log device fsmap backend doesn't have an rmapbt to query,
so it's wasteful to spend time initializing the rmap_irec objects.
Worse yet, the log could (someday) be longer than 2^32 fsblocks, so
using the rmap irec structure will result in integer overflows.

Fix this mess by computing the start address that we want from keys[0]
directly, and use the daddr-based record filtering algorithm that we
also use for rtbitmap queries.

Fixes: e89c041338ed ("xfs: implement the GETFSMAP ioctl")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
Acked-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/xfs/xfs_fsmap.c