Skip to content

Commit 6c8127e

Browse files
author
Darrick J. Wong
committed
xfs: xfs_bmap_finish_one should map unwritten extents properly
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> Reviewed-by: Christoph Hellwig <hch@lst.de>
1 parent 52f8070 commit 6c8127e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/xfs/libxfs/xfs_bmap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6245,6 +6245,8 @@ xfs_bmap_finish_one(
62456245

62466246
switch (bi->bi_type) {
62476247
case XFS_BMAP_MAP:
6248+
if (bi->bi_bmap.br_state == XFS_EXT_UNWRITTEN)
6249+
flags |= XFS_BMAPI_PREALLOC;
62486250
error = xfs_bmapi_remap(tp, bi->bi_owner, bmap->br_startoff,
62496251
bmap->br_blockcount, bmap->br_startblock,
62506252
flags);

0 commit comments

Comments
 (0)