]> git.itanic.dy.fi Git - linux-stable/commit
xfs: attach dquots and reserve quota blocks during unwritten conversion
authorDarrick J. Wong <darrick.wong@oracle.com>
Sat, 24 Sep 2022 12:56:44 +0000 (18:26 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:04:10 +0000 (11:04 +0200)
commit796ff09598cdb1389c4aff629b5b68e9a8455fa1
treeb0fc3faa44058cdcf49cd0b03f8971341eb34310
parenta33bcad48b48fa413039be1bf3266c3c8a38dc69
xfs: attach dquots and reserve quota blocks during unwritten conversion

commit 2815a16d7ff6230a8e37928829d221bb075aa160 upstream.

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?

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_iomap.c