Re: [PATCH 2/3] xfs: attach dquots and reserve quota blocks during unwritten conversion

Christoph Hellwig
2019-11-11T07:59:46Z

On Sun, Nov 10, 2019 at 05:18:27PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> In xfs_iomap_write_unwritten, we need to ensure that dquots are attached
> to the inode and quota blocks reserved so that we capture in the quota
> counters any blocks allocated to handle a bmbt split. This can happen
> on the first unwritten extent conversion to a preallocated sparse file
> on a fresh mount.
>
> This was found by running generic/311 with quotas enabled. The bug
> seems to have been introduced in "[XFS] rework iocore infrastructure,
> remove some code and make it more" from ~2002?

Wow. The fix looks correct, but I can't see how we got away with that
for so long..

Reviewed-by: Christoph Hellwig <hch@lst.de>