Message ID | 165176673695.248587.16584045364969444033.stgit@magnolia (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | mkfs: various bug fixes | expand |
On Thu, May 05, 2022 at 09:05:36AM -0700, Darrick J. Wong wrote: > + /* > + * If the end of the log has been rounded past the end of the AG, > + * reduce logblocks by a stripe unit to try to get it back under EOAG. > + */ > + if (!libxfs_verify_fsbext(mp, cfg->logstart, cfg->logblocks) && > + cfg->logblocks > sunit) { > + cfg->logblocks -= sunit; > + } The curly braces look a little out of place here, but otherwise this looks good: Reviewed-by: Christoph Hellwig <hch@lst.de>
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index b932acaa..01d2e8ca 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -3234,6 +3234,15 @@ _("Due to stripe alignment, the internal log start (%lld) cannot be aligned\n" /* round up/down the log size now */ align_log_size(cfg, sunit, max_logblocks); + /* + * If the end of the log has been rounded past the end of the AG, + * reduce logblocks by a stripe unit to try to get it back under EOAG. + */ + if (!libxfs_verify_fsbext(mp, cfg->logstart, cfg->logblocks) && + cfg->logblocks > sunit) { + cfg->logblocks -= sunit; + } + /* check the aligned log still starts and ends in the same AG. */ if (!libxfs_verify_fsbext(mp, cfg->logstart, cfg->logblocks)) { fprintf(stderr,