generic: reserve correct indirect blocks for delalloc write path
authorEryu Guan <eguan@redhat.com>
Mon, 4 Sep 2017 09:38:19 +0000 (17:38 +0800)
committerEryu Guan <eguan@redhat.com>
Sun, 17 Sep 2017 14:24:27 +0000 (22:24 +0800)
commit71d1ae5b8f5c4292c12dc119cb7c82f66dc96fbf
treed786faa7fd86123f6990fd22c88bf5ac8cf6d0ef
parent642eb97b9f99dcc1a72dc7c3e83c0862b38682c9
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>
tests/generic/460 [new file with mode: 0755]
tests/generic/460.out [new file with mode: 0644]
tests/generic/group