mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
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>
This commit is contained in:
parent
52f807067b
commit
6c8127e93e
@ -6245,6 +6245,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);
|
||||
|
Loading…
Reference in New Issue
Block a user