]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mkfs.xfs: avoid potential overflowing expression in xfs_mkfs.c
authorBill O'Donnell <bodonnel@redhat.com>
Fri, 14 Jun 2024 16:00:13 +0000 (11:00 -0500)
committerCarlos Maiolino <cem@kernel.org>
Mon, 17 Jun 2024 11:54:38 +0000 (13:54 +0200)
Cast max_tx_bytes to uint64_t to avoid overflowing expression in
calc_concurrency_logblocks().

Coverity-id: 1596603

Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
mkfs/xfs_mkfs.c

index 4f2d529aafc580dd23f637d0434fe68628b871b4..6d2469c3c81fa81cb460ddbb13fe07bf6135c5bd 100644 (file)
@@ -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);