aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-01-19 11:56:04 -0500
committerDarrick J. Wong <darrick.wong@oracle.com>2018-01-29 10:27:22 -0500
commit09ac862397041fc484cd7294b15d41073aa78864 (patch)
treef80d5fcf80806d92fa0c007004e0180077902f46
parent6ca30729c206d62d88730a904af7d543a56273d8 (diff)
xfs: call xfs_qm_dqattach before performing reflink operations
Ensure that we've attached all the necessary dquots before performing reflink operations so that quota accounting is accurate. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--fs/xfs/xfs_reflink.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index 47aea2e82c26..bcc2ad4f0899 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -1295,6 +1295,11 @@ xfs_reflink_remap_range(
1295 if (ret <= 0) 1295 if (ret <= 0)
1296 goto out_unlock; 1296 goto out_unlock;
1297 1297
1298 /* Attach dquots to dest inode before changing block map */
1299 ret = xfs_qm_dqattach(dest, 0);
1300 if (ret)
1301 goto out_unlock;
1302
1298 trace_xfs_reflink_remap_range(src, pos_in, len, dest, pos_out); 1303 trace_xfs_reflink_remap_range(src, pos_in, len, dest, pos_out);
1299 1304
1300 /* 1305 /*