diff mbox series

[RFC,4/4] fs/xfs: iomap: update the extent list after a COW

Message ID 20190417012715.8287-5-ruansy.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show
Series xfs: add handle for reflink in dax | expand

Commit Message

Ruan Shiyang April 17, 2019, 1:27 a.m. UTC
COW allocated new extents, which are new part of the inode,  So we
need to update the metadata.

Signed-off-by: Shiyang Ruan <ruansy.fnst@cn.fujitsu.com>
---
 fs/xfs/xfs_iomap.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index a45b4e5a1d87..5c05c11e0cb2 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -1146,6 +1146,9 @@  xfs_file_iomap_end(
 	if ((flags & IOMAP_WRITE) && iomap->type == IOMAP_DELALLOC)
 		return xfs_file_iomap_end_delalloc(XFS_I(inode), offset,
 				length, written, iomap);
+	/* update the extent list after a COW operation */
+	if (iomap->flags & IOMAP_F_SHARED && iomap->src_addr)
+		return xfs_reflink_end_cow(XFS_I(inode), offset, length);
 	return 0;
 }