Brian Foster b2a8864728 xfs: fix inode allocation block res calculation precedence
The block reservation calculation for inode allocation is supposed
to consist of the blocks required for the inode chunk plus
(maxlevels-1) of the inode btree multiplied by the number of inode
btrees in the fs (2 when finobt is enabled, 1 otherwise).

Instead, the macro returns (ialloc_blocks + 2) due to a precedence
error in the calculation logic. This leads to block reservation
overruns via generic/531 on small block filesystems with finobt
enabled. Add braces to fix the calculation and reserve the
appropriate number of blocks.

Fixes: 9d43b180af67 ("xfs: update inode allocation/free transaction reservations for finobt")
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2020-07-28 20:24:14 -07:00
..
2018-06-06 14:17:53 -07:00
2020-03-02 20:55:55 -08:00
2020-06-02 19:21:40 -07:00
2019-10-28 08:37:54 -07:00
2020-07-06 10:46:58 -07:00
2020-07-06 10:46:58 -07:00
2020-03-11 09:11:39 -07:00
2018-06-06 14:17:53 -07:00
2020-07-06 10:46:58 -07:00
2018-06-06 14:17:53 -07:00
2020-05-07 08:27:48 -07:00
2020-07-07 07:15:09 -07:00
2018-06-06 14:17:53 -07:00
2019-07-03 08:21:58 -07:00
2019-07-03 08:21:58 -07:00
2018-06-06 14:17:53 -07:00
2020-05-08 08:51:34 -07:00