Darrick J. Wong 363e59baa4 xfs: don't be so eager to clear the cowblocks tag on truncate
Currently, xfs_itruncate_extents clears the cowblocks tag if i_cnextents
is zero.  This is wrong, since i_cnextents only tracks real extents in
the CoW fork, which means that we could have some delayed CoW
reservations still in there that will now never get cleaned.

Fix a further bug where we /don't/ clear the reflink iflag if there are
any attribute blocks -- really, it's only safe to clear the reflink flag
if there are no data fork extents and no cow fork extents.

Found by adding clonerange to fsstress in xfs/017.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2017-12-21 08:47:28 -08:00
..
2017-12-08 17:51:05 -08:00
2017-11-15 18:21:01 -08:00
2013-05-07 18:45:36 -05:00
2017-11-09 15:50:29 -08:00
2017-10-26 15:38:26 -07:00
2017-09-02 08:22:19 -07:00
2011-08-12 16:21:35 -05:00
2017-11-17 09:51:57 -08:00
2017-04-03 15:18:17 -07:00
2017-11-09 15:50:29 -08:00
2017-11-09 15:50:29 -08:00
2017-10-26 15:38:27 -07:00
2017-08-04 13:43:36 -07:00
2017-10-18 18:51:27 -04:00
2017-12-08 17:51:05 -08:00
2017-11-17 09:51:57 -08:00
2017-09-01 10:55:30 -07:00
2017-09-01 10:55:30 -07:00