summaryrefslogtreecommitdiff
tag namewiden-idelayed_2019-04-18 (4dfd4583554cceb91371db95ffb90f7b2a974ee7)
tag date2019-04-18 16:59:07 -0700
tagged byDarrick J. Wong <darrick.wong@oracle.com>
tagged objectcommit b13d45600e...
xfs: prevent overflow of delalloc block counters
This series corrects an integer overflow problem in the inode i_delayed_blks counter that tracks the number of blocks assigned to the in-core inode but not reflected in the on-disk metadata. The first patch widens the in-core dquot to handle block reservations counts that are 64 bits in size. This is a requirement for the second patch, which widens i_delayed_blks to 64 bits. This rework is required to handle large amounts of COW staging blocks. Right now the only way to trigger it is to set the maximum cow extent size hint, reflink a very large (> 16T on a 4k block fs) sparse file, and then touch enough blocks to cause the cow reservations to exceed 2^32 blocks. This happens because i_delayed_blks tracks both actual delalloc reservations in data and cow forks as well as allocated but not yet remapped real extents in the cow fork. The overflow will become more practical when the atomic writes patch lands, whenever that is.