xfs: check min blks for random debug mode sparse allocations
authorBrian Foster <bfoster@redhat.com>
Thu, 4 Jun 2015 03:03:34 +0000 (13:03 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 4 Jun 2015 03:03:34 +0000 (13:03 +1000)
commit46fc58dacf6e9b00629c57998a8a23f85c262b3f
treeef2cf5db7380c932616a8d4f8c36135a8d95b97f
parent3cdaa1898ff3b16f69619cb5df2f45158e104817
xfs: check min blks for random debug mode sparse allocations

The inode allocator enables random sparse inode chunk allocations in
DEBUG mode to facilitate testing. Sparse inode allocations are not
always possible, however, depending on the fs geometry. For example,
there is no possibility for a sparse inode allocation on filesystems
where the block size is large enough to fit one or more inode chunks
within a single block.

Fix up the DEBUG mode sparse inode allocation logic to trigger random
sparse allocations only when the geometry of the fs allows it.

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