summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/xfs_bmap_util.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index e4126cae78b2..8319fd960638 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -708,12 +708,15 @@ xfs_can_free_eofblocks(
return false;
/*
- * Do not free real preallocated or append-only files unless the file
- * has delalloc blocks and we are forced to remove them.
+ * Do not free extent size hints, real preallocated or append-only files
+ * unless the file has delalloc blocks and we are forced to remove
+ * them.
*/
- if (ip->i_diflags & (XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND))
+ if (xfs_get_extsz_hint(ip) ||
+ (ip->i_diflags & (XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND))) {
if (!force || ip->i_delayed_blks == 0)
return false;
+ }
/*
* Do not try to free post-EOF blocks if EOF is beyond the end of the