Message ID | 159950111530.567664.7302518339658104292.stgit@magnolia (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | xfsprogs: various fixes for 5.9 | expand |
On Mon, Sep 07, 2020 at 10:51:55AM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@oracle.com> > > 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. Do we have a test for that? Othewise looks good: Reviewed-by: Christoph Hellwig <hch@lst.de>
On Tue, Sep 08, 2020 at 03:40:40PM +0100, Christoph Hellwig wrote: > On Mon, Sep 07, 2020 at 10:51:55AM -0700, Darrick J. Wong wrote: > > From: Darrick J. Wong <darrick.wong@oracle.com> > > > > 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. > > Do we have a test for that? Yeah, I'm going to do a huge fstests patchbomb after I come back from vacation next week. Sorry I didn't quite get to it in time. --D > Othewise looks good: > > Reviewed-by: Christoph Hellwig <hch@lst.de>
On 9/7/20 10:51 AM, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@oracle.com> > > 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@oracle.com> Ok looks good Reviewed-by: Allison Collins <allison.henderson@oracle.com> > --- > 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; >
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;