> So basically there are two bugs here -- the fcollapse/finsert code needs > to shift the CoW fork extents down and up; Or make sure that we don't have any extents in the COW fork? > diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c > index 9207d61..ae3b18f 100644 > --- a/fs/xfs/xfs_inode.c > +++ b/fs/xfs/xfs_inode.c > @@ -1625,7 +1625,7 @@ xfs_itruncate_extents( > /* > * Clear the reflink flag if we truncated everything. > */ > - if (ip->i_d.di_nblocks == 0 && xfs_is_reflink_inode(ip)) { > + if (ip->i_d.di_nblocks == 0 && ip->i_cnextents == 0 && xfs_is_reflink_inode(ip)) { Btw, it seems like we should generally clear the reflink flag and tag if ip->i_cnextents is zero and not even bother looking at di_nblocks. -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html