From: Bill O'Donnell Date: Fri, 14 Jun 2024 16:00:13 +0000 (-0500) Subject: mkfs.xfs: avoid potential overflowing expression in xfs_mkfs.c X-Git-Tag: v6.9.0~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e95efd2f07af7942e8dbd83727cf422bff36aa6;p=thirdparty%2Fxfsprogs-dev.git mkfs.xfs: avoid potential overflowing expression in xfs_mkfs.c Cast max_tx_bytes to uint64_t to avoid overflowing expression in calc_concurrency_logblocks(). Coverity-id: 1596603 Signed-off-by: Bill O'Donnell Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 4f2d529a..6d2469c3 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -3678,7 +3678,7 @@ calc_concurrency_logblocks( * without blocking for space. Increase the figure by 50% so that * background threads can also run. */ - log_bytes = max_tx_bytes * 3 * cli->log_concurrency / 2; + log_bytes = (uint64_t)max_tx_bytes * 3 * cli->log_concurrency / 2; new_logblocks = min(XFS_MAX_LOG_BYTES >> cfg->blocklog, log_bytes >> cfg->blocklog);