diff options
author | Takashi Iwai <tiwai@suse.de> | 2017-10-05 15:08:57 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-10-05 15:08:57 +0200 |
commit | 3a9fce327ff9cabf7f89d3f20616a83af28393da (patch) | |
tree | c516d3e7023e7fe2dc8d4cf60e2ec03f3c9b5958 /fs/xfs/xfs_inode.c | |
parent | e195a331c4124a6527e5e1b6fbd93a6b4a984d7b (diff) | |
parent | 394ca81cb4c1518e9463fe342fb1ae8a9f46a82d (diff) |
Merge branch 'topic/timer-api' into for-next
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r-- | fs/xfs/xfs_inode.c | 8 |
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); } |