summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-14 11:06:39 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-11-09 19:07:36 -0800
commit56e8741dec06c13fd695c73918fd877e58a5c3b0 (patch)
treef62242961914a6a56235242fefe758f5001e563c
parent4e50134f9bde12b9718c5a6e66b4dad12f4b8f73 (diff)
xfs: xfs_bmap_finish_one should map unwritten extents properlyexpand-bmap-intent-usage_2022-11-09
The deferred bmap work state and the log item can transmit unwritten state, so the XFS_BMAP_MAP handler must map in extents with that unwritten state. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index bd625dbf23e2..1662098a2439 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -6258,6 +6258,8 @@ xfs_bmap_finish_one(
switch (bi->bi_type) {
case XFS_BMAP_MAP:
+ if (bi->bi_bmap.br_state == XFS_EXT_UNWRITTEN)
+ flags |= XFS_BMAPI_PREALLOC;
error = xfs_bmapi_remap(tp, bi->bi_owner, bmap->br_startoff,
bmap->br_blockcount, bmap->br_startblock,
flags);