Message ID | 173568752897.2704305.6672105459508175150.stgit@frogsfrogsfrogs (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [1/1] xfs: Don't free EOF blocks on close when extent size hints are set | expand |
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index b0096ff91000ce..783349f2361ad3 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -527,8 +527,9 @@ xfs_can_free_eofblocks( * Do not free real extents in preallocated files unless the file has * delalloc blocks and we are forced to remove them. */ - if ((ip->i_diflags & XFS_DIFLAG_PREALLOC) && !ip->i_delayed_blks) - return false; + if (xfs_get_extsz_hint(ip) || (ip->i_diflags & XFS_DIFLAG_APPEND)) + if (ip->i_delayed_blks == 0) + return false; /* * Do not try to free post-EOF blocks if EOF is beyond the end of the