summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_inode.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_inode.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_inode.c')
-rw-r--r--fs/xfs/xfs_inode.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 5599dda4727a..4ec5b7f45401 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1624,10 +1624,12 @@ xfs_itruncate_extents(
goto out;
/*
- * Clear the reflink flag if we truncated everything.
+ * Clear the reflink flag if there are no data fork blocks and
+ * there are no extents staged in the cow fork.
*/
- if (ip->i_d.di_nblocks == 0 && xfs_is_reflink_inode(ip)) {
- ip->i_d.di_flags2 &= ~XFS_DIFLAG2_REFLINK;
+ if (xfs_is_reflink_inode(ip) && ip->i_cnextents == 0) {
+ if (ip->i_d.di_nblocks == 0)
+ ip->i_d.di_flags2 &= ~XFS_DIFLAG2_REFLINK;
xfs_inode_clear_cowblocks_tag(ip);
}