aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/libxfs')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 534ffb856c4a..3d7c53db1977 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -5109,7 +5109,8 @@ xfs_bmap_del_extent_real(
if (error)
goto done;
} else {
- if (bflags & XFS_BMAPI_NODISCARD) {
+ if ((bflags & XFS_BMAPI_NODISCARD) ||
+ (del->br_state == XFS_EXT_UNWRITTEN)) {
xfs_bmap_add_free_nodiscard(mp, dfops,
del->br_startblock, del->br_blockcount,
NULL);