xfs: fix computation of inode btree maxlevels
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 6 Mar 2016 21:39:56 +0000 (08:39 +1100)
committerDave Chinner <david@fromorbit.com>
Sun, 6 Mar 2016 21:39:56 +0000 (08:39 +1100)
commit49ca9118e6ecca63c78de924801b8b9fe4af44ff
tree68c86e265be6aa44525736ff666802b247e26615
parenta798011c8fd4286605b990c1722c16903fc14b7a
xfs: fix computation of inode btree maxlevels

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