diff options
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r-- | fs/xfs/xfs_bmap.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 6d9b5448deb2..eb198c01c35d 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
@@ -4153,16 +4153,21 @@ xfs_bmap_compute_maxlevels( | |||
4153 | * number of leaf entries, is controlled by the type of di_nextents | 4153 | * number of leaf entries, is controlled by the type of di_nextents |
4154 | * (a signed 32-bit number, xfs_extnum_t), or by di_anextents | 4154 | * (a signed 32-bit number, xfs_extnum_t), or by di_anextents |
4155 | * (a signed 16-bit number, xfs_aextnum_t). | 4155 | * (a signed 16-bit number, xfs_aextnum_t). |
4156 | * | ||
4157 | * Note that we can no longer assume that if we are in ATTR1 that | ||
4158 | * the fork offset of all the inodes will be (m_attroffset >> 3) | ||
4159 | * because we could have mounted with ATTR2 and then mounted back | ||
4160 | * with ATTR1, keeping the di_forkoff's fixed but probably at | ||
4161 | * various positions. Therefore, for both ATTR1 and ATTR2 | ||
4162 | * we have to assume the worst case scenario of a minimum size | ||
4163 | * available. | ||
4156 | */ | 4164 | */ |
4157 | if (whichfork == XFS_DATA_FORK) { | 4165 | if (whichfork == XFS_DATA_FORK) { |
4158 | maxleafents = MAXEXTNUM; | 4166 | maxleafents = MAXEXTNUM; |
4159 | sz = (mp->m_flags & XFS_MOUNT_ATTR2) ? | 4167 | sz = XFS_BMDR_SPACE_CALC(MINDBTPTRS); |
4160 | XFS_BMDR_SPACE_CALC(MINDBTPTRS) : mp->m_attroffset; | ||
4161 | } else { | 4168 | } else { |
4162 | maxleafents = MAXAEXTNUM; | 4169 | maxleafents = MAXAEXTNUM; |
4163 | sz = (mp->m_flags & XFS_MOUNT_ATTR2) ? | 4170 | sz = XFS_BMDR_SPACE_CALC(MINABTPTRS); |
4164 | XFS_BMDR_SPACE_CALC(MINABTPTRS) : | ||
4165 | mp->m_sb.sb_inodesize - mp->m_attroffset; | ||
4166 | } | 4171 | } |
4167 | maxrootrecs = (int)XFS_BTREE_BLOCK_MAXRECS(sz, xfs_bmdr, 0); | 4172 | maxrootrecs = (int)XFS_BTREE_BLOCK_MAXRECS(sz, xfs_bmdr, 0); |
4168 | minleafrecs = mp->m_bmap_dmnr[0]; | 4173 | minleafrecs = mp->m_bmap_dmnr[0]; |