summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-01-05 17:45:06 -0800
committerDarrick J. Wong <djwong@kernel.org>2021-08-25 22:25:59 -0700
commit9ac7538aac047fbcce77c2e90748b88e039360b6 (patch)
tree9d2b1c44b8916568bcb2036bb75670172308aabd
parent9fbe144e4ac97bd092576c61f73d3b0765ae6120 (diff)
xfs: xfs_bmap_finish_one should map unwritten extents properlyexpand-bmap-intent-usage_2021-08-25
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 271023303fe3..2e3f89b1e961 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -6288,6 +6288,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);