xfs: don't unconditionally clear the reflink flag on zero-block files
authorDarrick J. Wong <[email protected]>
Mon, 18 Sep 2017 16:41:16 +0000 (09:41 -0700)
committerDarrick J. Wong <[email protected]>
Tue, 26 Sep 2017 01:22:30 +0000 (18:22 -0700)
commitcc6f77710a6de6210f9feda7cd53e2f5ee7a7e69
treea312cbbabafd119183b5105baf9d4829e6056046
parent2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e
xfs: don't unconditionally clear the reflink flag on zero-block files

If we have speculative cow preallocations hanging around in the cow
fork, don't let a truncate operation clear the reflink flag because if
we do then there's a chance we'll forget to free those extents when we
destroy the incore inode.

Reported-by: Amir Goldstein <[email protected]>
Reviewed-by: Carlos Maiolino <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Darrick J. Wong <[email protected]>
fs/xfs/xfs_inode.c