Skip to content

Commit

Permalink
xfs: add missing cmap->br_state = XFS_EXT_NORM update
Browse files Browse the repository at this point in the history
[ Upstream commit 1a39ae4 ]

COW extents are already converted into written real extents after
xfs_reflink_convert_cow_locked(), therefore cmap->br_state should
reflect it.

Otherwise, there is another necessary unwritten convertion
triggered in xfs_dio_write_end_io() for direct I/O cases.

Signed-off-by: Gao Xiang <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Signed-off-by: Darrick J. Wong <[email protected]>
Signed-off-by: Leah Rumancik <[email protected]>
Acked-by: Chandan Babu R <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
hsiangkao authored and gregkh committed Nov 28, 2023
1 parent 8d0baec commit 92d38b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/xfs/xfs_reflink.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,10 @@ xfs_reflink_allocate_cow(
if (!convert_now || cmap->br_state == XFS_EXT_NORM)
return 0;
trace_xfs_reflink_convert_cow(ip, cmap);
return xfs_reflink_convert_cow_locked(ip, offset_fsb, count_fsb);
error = xfs_reflink_convert_cow_locked(ip, offset_fsb, count_fsb);
if (!error)
cmap->br_state = XFS_EXT_NORM;
return error;

out_trans_cancel:
xfs_trans_cancel(tp);
Expand Down

0 comments on commit 92d38b8

Please sign in to comment.