generic: reserve correct indirect blocks for delalloc write path

Test that XFS reserves reasonable indirect blocks for delalloc and
speculative allocation, and doesn't cause any fdblocks corruption.

This was inspired by an XFS but that too large 'indlen' was returned by
xfs_bmap_worst_indlen() which can't fit in a 17 bits value
(STARTBLOCKVALBITS is defined as 17), then leaked 1 << 17 blocks in
sb_fdblocks.

This was only seen on XFS with rmapbt feature enabled, but nothing
prevents the test from being a generic test.

Reviewed-by: "Darrick J. Wong" <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
3 files changed