From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 3/6] xfs: fix computation of inode btree maxlevels
Date: Mon, 7 Mar 2016 08:49:47 +1100 [thread overview]
Message-ID: <1457300990-18300-4-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1457300990-18300-1-git-send-email-david@fromorbit.com>
From: "Darrick J. Wong" <darrick.wong@oracle.com>
Commit 88740da18[1] introduced a function to compute the maximum
height of the inode btree back in 1994. Back then, apparently, the
freespace and inode btrees shared the same geometry; however, it has
long since been the case that the inode and freespace btrees have
different record and key sizes. Therefore, we must use m_inobt_mnr if
we want a correct calculation/log reservation/etc.
(Yes, this bug has been around for 21 years and ten months.)
(Yes, I was in middle school when this bug was committed.)
[1] http://oss.sgi.com/cgi-bin/gitweb.cgi?p=archive/xfs-import.git;a=commitdiff;h=88740da18ddd9d7ba3ebaa9502fefc6ef2fd19cd
Historical-research-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
---
fs/xfs/libxfs/xfs_ialloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index 66d702e..22297f9 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -2403,8 +2403,8 @@ xfs_ialloc_compute_maxlevels(
maxleafents = (1LL << XFS_INO_AGINO_BITS(mp)) >>
XFS_INODES_PER_CHUNK_LOG;
- minleafrecs = mp->m_alloc_mnr[0];
- minnoderecs = mp->m_alloc_mnr[1];
+ minleafrecs = mp->m_inobt_mnr[0];
+ minnoderecs = mp->m_inobt_mnr[1];
maxblocks = (maxleafents + minleafrecs - 1) / minleafrecs;
for (level = 1; maxblocks > 1; level++)
maxblocks = (maxblocks + minnoderecs - 1) / minnoderecs;
--
2.7.0
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-03-06 21:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-06 21:49 [PATCH 0/6] xfs: accumulated fixes for 4.6 Dave Chinner
2016-03-06 21:49 ` [PATCH 1/6] xfs: reinitialise per-AG structures if geometry changes during recovery Dave Chinner
2016-03-07 16:24 ` Christoph Hellwig
2016-03-06 21:49 ` [PATCH 2/6] xfs: ioends require logically contiguous file offsets Dave Chinner
2016-03-07 16:26 ` Christoph Hellwig
2016-03-08 2:33 ` Darrick J. Wong
2016-03-08 7:01 ` Christoph Hellwig
2016-03-06 21:49 ` Dave Chinner [this message]
2016-03-06 21:49 ` [PATCH 4/6] xfs: use named array initializers for log item dumping Dave Chinner
2016-03-07 16:27 ` Christoph Hellwig
2016-03-06 21:49 ` [PATCH 5/6] xfs: check sizes of XFS on-disk structures at compile time Dave Chinner
2016-03-07 16:27 ` Christoph Hellwig
2016-03-06 21:49 ` [PATCH 6/6] xfs: pad xfs_attr_leaf_name_remote to avoid tripping on m68k Dave Chinner
2016-03-07 16:28 ` Christoph Hellwig
2016-03-08 3:56 ` Dave Chinner
2016-03-08 7:02 ` Christoph Hellwig
2016-03-08 17:34 ` Christoph Hellwig
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=1457300990-18300-4-git-send-email-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=xfs@oss.sgi.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