From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Eric Sandeen <sandeen@redhat.com>, xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] mkfs: set agblklog when we're verifying minimum log size
Date: Fri, 7 Jul 2017 08:01:41 -0400 [thread overview]
Message-ID: <20170707120139.GC61756@bfoster.bfoster> (raw)
In-Reply-To: <20170707033138.GC4103@magnolia>
On Thu, Jul 06, 2017 at 08:31:38PM -0700, Darrick J. Wong wrote:
> In e5cc9d560a ("mkfs: set agsize prior to calculating minimum log
> size"), we set the ag size in the superblock structure so that we can
> calculate the maximum btree height correctly. The btree heights are
> used to calculate transaction reservation sizes; these sizes are used to
> compute the minimum log length; and the minimum log length is checked by
> the kernel.
>
> Unfortunately, I didn't realize that some of the btree sizing functions
> also depend on the agblklog (log2 of the ag size), so we've been
> underestimating the minimum log length allowable, which results in mkfs
> formatting filesystems that the kernel refuses to mount.
>
> This can be trivially reproduced by formatting a small (~800M) volume
> with rmap and reflink turned on.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> mkfs/maxtrres.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/mkfs/maxtrres.c b/mkfs/maxtrres.c
> index fba7818..69ec67a 100644
> --- a/mkfs/maxtrres.c
> +++ b/mkfs/maxtrres.c
> @@ -54,6 +54,7 @@ max_trans_res(
> sbp->sb_blocklog = blocklog;
> sbp->sb_blocksize = 1 << blocklog;
> sbp->sb_agblocks = agsize;
> + sbp->sb_agblklog = (uint8_t)libxfs_log2_roundup((unsigned int)agsize);
> sbp->sb_inodelog = inodelog;
> sbp->sb_inopblog = blocklog - inodelog;
> sbp->sb_inodesize = 1 << inodelog;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2017-07-07 12:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-07 3:31 [PATCH] mkfs: set agblklog when we're verifying minimum log size Darrick J. Wong
2017-07-07 3:51 ` [PATCH] mkfs: set inode alignment and cluster size for minimum log size estimation Darrick J. Wong
2017-07-07 12:01 ` Brian Foster
2017-07-07 12:01 ` Brian Foster [this message]
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=20170707120139.GC61756@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox