Commit 0fb823f1 authored by Darrick J. Wong's avatar Darrick J. Wong Committed by Carlos Maiolino
Browse files

xfs: fix integer overflow in xrep_bmap



The variable declaration in this function predates the merge of the
nrext64 (aka 64-bit extent counters) feature, which means that the
variable declaration type is insufficient to avoid an integer overflow.
Fix that by redeclaring the variable to be xfs_extnum_t.

Coverity-id: 1630958
Fixes: 8f71bede ("xfs: repair inode fork block mapping data structures")
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
parent 77bfe1b1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -801,7 +801,7 @@ xrep_bmap(
{
	struct xrep_bmap	*rb;
	char			*descr;
	unsigned int		max_bmbt_recs;
	xfs_extnum_t		max_bmbt_recs;
	bool			large_extcount;
	int			error = 0;