[Cluster-devel] [PATCH 20/20] mkfs.gfs2: Silence an integer overflow warning

Andrew Price anprice at redhat.com
Mon Mar 5 18:25:49 UTC 2018


No bug here, just need to acknowledge the widening.

Signed-off-by: Andrew Price <anprice at redhat.com>
---
 gfs2/mkfs/main_mkfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index 42ce6dd6..297ff7a3 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -840,7 +840,7 @@ static int default_journal_size(unsigned bsize, uint64_t num_blocks)
 		return (16384);                 /* 64 MB */
 	if (num_blocks < 262144*1024)   /*  1 TB */
 		return (32768);                 /* 128 MB */
-	if (num_blocks < 2621440*1024)  /* 10 TB */
+	if (num_blocks < 2621440UL*1024)  /* 10 TB */
 		return (131072);                /* 512 MB */
 	return 262144;                          /*   1 GB */
 }
-- 
2.14.3




More information about the Cluster-devel mailing list