Эх сурвалжийг харах

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>
Darrick J. Wong 7 жил өмнө
parent
commit
09ac862397
1 өөрчлөгдсөн 5 нэмэгдсэн , 0 устгасан
  1. 5 0
      fs/xfs/xfs_reflink.c

+ 5 - 0
fs/xfs/xfs_reflink.c

@@ -1295,6 +1295,11 @@ xfs_reflink_remap_range(
 	if (ret <= 0)
 		goto out_unlock;
 
+	/* Attach dquots to dest inode before changing block map */
+	ret = xfs_qm_dqattach(dest, 0);
+	if (ret)
+		goto out_unlock;
+
 	trace_xfs_reflink_remap_range(src, pos_in, len, dest, pos_out);
 
 	/*