From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 11/12] mkfs: validate start and end of aligned logs
Date: Wed, 22 May 2019 09:42:30 -0700 [thread overview]
Message-ID: <20190522164230.GE5141@magnolia> (raw)
In-Reply-To: <03cd588a-f4b0-0c79-4862-31ae0e5cd3dd@sandeen.net>
On Tue, May 21, 2019 at 02:24:40PM -0500, Eric Sandeen wrote:
> On 5/20/19 6:17 PM, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > Validate that the start and end of the log stay within a single AG if
> > we adjust either end to align to stripe units.
> >
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> > mkfs/xfs_mkfs.c | 15 ++++++++++++++-
> > 1 file changed, 14 insertions(+), 1 deletion(-)
> >
> >
> > diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> > index 5b66074d..8f84536e 100644
> > --- a/mkfs/xfs_mkfs.c
> > +++ b/mkfs/xfs_mkfs.c
> > @@ -3044,15 +3044,28 @@ align_internal_log(
> > struct xfs_mount *mp,
> > int sunit)
> > {
> > + uint64_t logend;
> > +
> > /* round up log start if necessary */
> > if ((cfg->logstart % sunit) != 0)
> > cfg->logstart = ((cfg->logstart + (sunit - 1)) / sunit) * sunit;
> >
> > + /* if our log start rounds into the next AG we're done */
>
> /* If our log start overlaps the next AG's metadata, fail */
Ok.
> > + if (!xfs_verify_fsbno(mp, cfg->logstart)) {
> > + fprintf(stderr,
> > +_("Due to stripe alignment, the internal log start (%lld) cannot be aligned\n"
> > + "within an allocation group.\n"),
> > + (long long) cfg->logstart);
>
> Hm, should it suggest what should be modified to try again ...?
But what should be modified, exactly? -d su=0,sw=0?
> > + usage();
> > + }
> > +
> > /* round up/down the log size now */
> > align_log_size(cfg, sunit);
> >
> > /* check the aligned log still fits in an AG. */
> > - if (cfg->logblocks > cfg->agsize - XFS_FSB_TO_AGBNO(mp, cfg->logstart)) {
> > + logend = cfg->logstart + cfg->logblocks - 1;
> > + if (XFS_FSB_TO_AGNO(mp, cfg->logstart) != XFS_FSB_TO_AGNO(mp, logend) ||
> > + !xfs_verify_fsbno(mp, logend)) {
>
> this xfs_verify_fsbno is probably redundant but can't hurt?
<nod>
Will respin patch.
--D
> -Eric
>
> > fprintf(stderr,
> > _("Due to stripe alignment, the internal log size (%lld) is too large.\n"
> > "Must fit within an allocation group.\n"),
> >
next prev parent reply other threads:[~2019-05-22 16:42 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-20 23:16 [PATCH 00/12] xfsprogs-5.1: fix various problems Darrick J. Wong
2019-05-20 23:16 ` [PATCH 01/12] libxfs: fix attr include mess Darrick J. Wong
2019-05-21 16:30 ` Eric Sandeen
2019-05-20 23:16 ` [PATCH 02/12] libxfs: set m_finobt_nores when initializing library Darrick J. Wong
2019-05-21 16:33 ` Eric Sandeen
2019-05-20 23:17 ` [PATCH 03/12] libxfs: refactor online geometry queries Darrick J. Wong
2019-05-21 16:38 ` Eric Sandeen
2019-05-21 16:58 ` Darrick J. Wong
2019-05-20 23:17 ` [PATCH 04/12] libxfs: refactor open-coded bulkstat calls Darrick J. Wong
2019-05-20 23:17 ` [PATCH 05/12] libxfs: refactor open-coded INUMBERS calls Darrick J. Wong
2019-05-20 23:17 ` [PATCH 06/12] misc: remove all use of xfs_fsop_geom_t Darrick J. Wong
2019-05-21 16:43 ` Eric Sandeen
2019-05-21 16:58 ` Darrick J. Wong
2019-05-20 23:17 ` [PATCH 07/12] libfrog: fix bitmap return values Darrick J. Wong
2019-05-21 16:54 ` Eric Sandeen
2019-05-21 17:01 ` Darrick J. Wong
2019-05-21 18:59 ` Eric Sandeen
2019-05-21 19:19 ` Christoph Hellwig
2019-05-21 19:20 ` Eric Sandeen
2019-05-21 19:28 ` Christoph Hellwig
2019-05-21 19:33 ` Eric Sandeen
2019-05-22 16:23 ` Eric Sandeen
2019-05-20 23:17 ` [PATCH 08/12] xfs_repair: refactor namecheck functions Darrick J. Wong
2019-05-21 19:16 ` Eric Sandeen
2019-05-20 23:17 ` [PATCH 09/12] xfs_scrub: fix background-mode sleep throttling Darrick J. Wong
2019-05-21 19:18 ` Eric Sandeen
2019-05-20 23:17 ` [PATCH 10/12] mkfs: allow setting dax flag on root directory Darrick J. Wong
2019-05-21 19:19 ` Eric Sandeen
2019-05-20 23:17 ` [PATCH 11/12] mkfs: validate start and end of aligned logs Darrick J. Wong
2019-05-21 19:24 ` Eric Sandeen
2019-05-22 16:42 ` Darrick J. Wong [this message]
2019-05-20 23:18 ` [PATCH 12/12] mkfs: enable reflink by default Darrick J. Wong
2019-05-21 19:27 ` Eric Sandeen
2019-05-21 19:30 ` [PATCH 12/12 V2] " Eric Sandeen
2019-05-22 16:44 ` Darrick J. Wong
2019-05-22 16:46 ` Eric Sandeen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190522164230.GE5141@magnolia \
--to=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.