summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_bmap_util.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-10-03 09:35:04 +1000
committerDave Airlie <airlied@redhat.com>2017-10-03 09:35:04 +1000
commitebec44a2456fbe5fe18aae88f6010f6878f0cb4a (patch)
tree427734722bdf3e807333329f33a6dbd6e95ec747 /fs/xfs/xfs_bmap_util.c
parent659333de48268550b5f09fcd45f76459d737b946 (diff)
parent9e66317d3c92ddaab330c125dfe9d06eee268aff (diff)
downloadlinux-ebec44a2456fbe5fe18aae88f6010f6878f0cb4a.tar.gz
linux-ebec44a2456fbe5fe18aae88f6010f6878f0cb4a.tar.bz2
linux-ebec44a2456fbe5fe18aae88f6010f6878f0cb4a.zip
BackMerge tag 'v4.14-rc3' into drm-next
Linux 4.14-rc3 Requested by Daniel for the tracing build fix in fixes.
Diffstat (limited to 'fs/xfs/xfs_bmap_util.c')
-rw-r--r--fs/xfs/xfs_bmap_util.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index cd9a5400ba4f..bc6c6e10a969 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -1459,7 +1459,19 @@ xfs_shift_file_space(
return error;
/*
- * The extent shiting code works on extent granularity. So, if
+ * Clean out anything hanging around in the cow fork now that
+ * we've flushed all the dirty data out to disk to avoid having
+ * CoW extents at the wrong offsets.
+ */
+ if (xfs_is_reflink_inode(ip)) {
+ error = xfs_reflink_cancel_cow_range(ip, offset, NULLFILEOFF,
+ true);
+ if (error)
+ return error;
+ }
+
+ /*
+ * The extent shifting code works on extent granularity. So, if
* stop_fsb is not the starting block of extent, we need to split
* the extent at stop_fsb.
*/