diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-01-05 17:45:06 -0800 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-03-25 17:08:26 -0700 |
commit | 77c6f6fdc03a5d1683b9a2713f91fb684ccd4ca5 (patch) | |
tree | 0d1535ae0b66267004fad374dd8ae3d4ff350e18 | |
parent | 6b9c4713cf54a04d0329d3bf8456358bef8cbbc1 (diff) |
xfs: xfs_bmap_finish_one should map unwritten extents properlyexpand-bmap-intent-usage_2021-03-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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index dba52cb362e2..ab41ea1f4740 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -6398,6 +6398,8 @@ xfs_bmap_finish_one( switch (type) { case XFS_BMAP_MAP: + if (state == XFS_EXT_UNWRITTEN) + flags |= XFS_BMAPI_PREALLOC; error = xfs_bmapi_remap(tp, ip, startoff, *blockcount, startblock, flags); *blockcount = 0; |