[PATCH 4/4] mkfs: set required parts of the realtime geometry before computing log geometry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

The minimum log size depends on the transaction reservation sizes, which
in turn depend on the realtime device geometry.  Therefore, we need to
set up some of the rt geometry before we can compute the real minimum
log size.

This fixes a problem where mkfs, given a small data device and a
realtime volume, formats a filesystem with a log that is too small to
pass the mount time log size checks.

Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
---
 mkfs/xfs_mkfs.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 6b55ca3e4c57..408198e9ec70 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -3237,6 +3237,9 @@ start_superblock_setup(
 	} else
 		sbp->sb_logsunit = 0;
 
+	/* log reservation calculations depend on rt geometry */
+	sbp->sb_rblocks = cfg->rtblocks;
+	sbp->sb_rextsize = cfg->rtextblocks;
 }
 
 static void
@@ -3274,14 +3277,12 @@ finish_superblock_setup(
 	}
 
 	sbp->sb_dblocks = cfg->dblocks;
-	sbp->sb_rblocks = cfg->rtblocks;
 	sbp->sb_rextents = cfg->rtextents;
 	platform_uuid_copy(&sbp->sb_uuid, &cfg->uuid);
 	/* Only in memory; libxfs expects this as if read from disk */
 	platform_uuid_copy(&sbp->sb_meta_uuid, &cfg->uuid);
 	sbp->sb_logstart = cfg->logstart;
 	sbp->sb_rootino = sbp->sb_rbmino = sbp->sb_rsumino = NULLFSINO;
-	sbp->sb_rextsize = cfg->rtextblocks;
 	sbp->sb_agcount = (xfs_agnumber_t)cfg->agcount;
 	sbp->sb_rbmblocks = cfg->rtbmblocks;
 	sbp->sb_logblocks = (xfs_extlen_t)cfg->logblocks;




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux