summaryrefslogtreecommitdiff
path: root/fs/xfs
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-10-08 07:07:08 +0300
committerCarlos Maiolino <cem@kernel.org>2024-10-11 13:32:48 +0300
commit0fb823f1cf3417e06846d1ffe2c97e10a65a847e (patch)
tree24c01701291bd162518e5d19d286306252ceb075 /fs/xfs
parent77bfe1b11ea0c0c4b0ce19b742cd1aa82f60e45d (diff)
downloadlinux-0fb823f1cf3417e06846d1ffe2c97e10a65a847e.tar.xz
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: 8f71bede8efd ("xfs: repair inode fork block mapping data structures") Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Carlos Maiolino <cem@kernel.org>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/scrub/bmap_repair.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/scrub/bmap_repair.c b/fs/xfs/scrub/bmap_repair.c
index 49dc38acc66b..4505f4829d53 100644
--- a/fs/xfs/scrub/bmap_repair.c
+++ b/fs/xfs/scrub/bmap_repair.c
@@ -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;