]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs: update free inode record logic to support sparse inode records
authorBrian Foster <bfoster@redhat.com>
Thu, 28 May 2015 22:51:37 +0000 (08:51 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 23 Jun 2015 05:06:28 +0000 (15:06 +1000)
commitfa56ad575daafde0fa8aed4222f5ed8c76a80ccd
tree3f0a000b3b5dd06e6fa8bc1a017d18528ca7e90d
parent214acbb39dbcd9f2b40ae290cf0576d6fdb338d3
xfs: update free inode record logic to support sparse inode records

xfs_difree_inobt() uses logic in a couple places that assume inobt
records refer to fully allocated chunks. Specifically, the use of
mp->m_ialloc_inos can cause problems for inode chunks that are sparsely
allocated. Sparse inode chunks can, by definition, define a smaller
number of inodes than a full inode chunk.

Fix the logic that determines whether an inode record should be removed
from the inobt to use the ir_free mask rather than ir_freecount. Fix the
agi counters modification to use ir_freecount to add the actual number
of inodes freed rather than assuming a full inode chunk.

Also make sure that we preserve the behavior to not remove inode chunks
if the block size is large enough for multiple inode chunks (e.g.,
bsize=64k, isize=512). This behavior was previously implicit in that in
such configurations, ir.freecount of a single record never matches
m_ialloc_inos. Hence, add some comments as well.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxfs/xfs_ialloc.c