Blame SOURCES/xfsprogs-5.1.0-xfsprogs-Fix-uninitialized-cfg-lsunit.patch

14809d
From 59cf967983f6aaff4ce33a50135ae57032ebd8f2 Mon Sep 17 00:00:00 2001
14809d
From: Allison Collins <allison.henderson@oracle.com>
14809d
Date: Wed, 10 Jul 2019 11:38:04 -0400
14809d
Subject: [PATCH] xfsprogs: Fix uninitialized cfg->lsunit
14809d
14809d
While investigating another mkfs bug, noticed that cfg->lsunit is sometimes
14809d
left uninitialized when it should not.  This is because calc_stripe_factors
14809d
in some cases needs cfg->loginternal to be set first.  This is done in
14809d
validate_logdev. So move calc_stripe_factors below validate_logdev while
14809d
parsing configs.
14809d
14809d
Signed-off-by: Allison Collins <allison.henderson@oracle.com>
14809d
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
14809d
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
14809d
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
14809d
---
14809d
 mkfs/xfs_mkfs.c | 2 +-
14809d
 1 file changed, 1 insertion(+), 1 deletion(-)
14809d
14809d
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
14809d
index 79377b12..65cf1e0f 100644
14809d
--- a/mkfs/xfs_mkfs.c
14809d
+++ b/mkfs/xfs_mkfs.c
14809d
@@ -4007,7 +4007,6 @@ main(
14809d
 	cfg.rtblocks = calc_dev_size(cli.rtsize, &cfg, &ropts, R_SIZE, "rt");
14809d
 
14809d
 	validate_rtextsize(&cfg, &cli, &ft;;
14809d
-	calc_stripe_factors(&cfg, &cli, &ft;;
14809d
 
14809d
 	/*
14809d
 	 * Open and validate the device configurations
14809d
@@ -4017,6 +4016,7 @@ main(
14809d
 	validate_datadev(&cfg, &cli;;
14809d
 	validate_logdev(&cfg, &cli, &logfile);
14809d
 	validate_rtdev(&cfg, &cli, &rtfile);
14809d
+	calc_stripe_factors(&cfg, &cli, &ft;;
14809d
 
14809d
 	/*
14809d
 	 * At this point when know exactly what size all the devices are,
14809d
-- 
14809d
2.17.0
14809d