diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2019-11-09 21:04:30 +0100 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-11-11 21:42:52 +0100 |
commit | 2713fefa5dd511b18ddc73b978273eec3ae08f6d (patch) | |
tree | 48d6631278b7e02228ef5fc4046242a71b35fda0 | |
parent | xfs: attach dquots and reserve quota blocks during unwritten conversion (diff) | |
download | linux-2713fefa5dd511b18ddc73b978273eec3ae08f6d.tar.xz linux-2713fefa5dd511b18ddc73b978273eec3ae08f6d.zip |
xfs: attach dquots before performing xfs_swap_extents
Make sure we attach dquots to both inodes before swapping their extents.
This was found via manual code inspection by looking for places where we
could call xfs_trans_mod_dquot without dquots attached to inodes, and
confirmed by instrumenting the kernel and running xfs/328.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | fs/xfs/xfs_bmap_util.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 9d731b71e84f..2efd78a9719e 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -1569,6 +1569,14 @@ xfs_swap_extents( goto out_unlock; } + error = xfs_qm_dqattach(ip); + if (error) + goto out_unlock; + + error = xfs_qm_dqattach(tip); + if (error) + goto out_unlock; + error = xfs_swap_extent_flush(ip); if (error) goto out_unlock; |