From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: xfs <linux-xfs@vger.kernel.org>, Brian Foster <bfoster@redhat.com>
Subject: [PATCH] mkfs: set agblklog when we're verifying minimum log size
Date: Thu, 6 Jul 2017 20:31:38 -0700 [thread overview]
Message-ID: <20170707033138.GC4103@magnolia> (raw)
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>
---
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;
next reply other threads:[~2017-07-07 3:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-07 3:31 Darrick J. Wong [this message]
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 ` [PATCH] mkfs: set agblklog when we're verifying minimum log size Brian Foster
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=20170707033138.GC4103@magnolia \
--to=darrick.wong@oracle.com \
--cc=bfoster@redhat.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