Skip to content

Commit 1a39ae4

Browse files
hsiangkaoDarrick J. Wong
authored andcommitted
xfs: add missing cmap->br_state = XFS_EXT_NORM update
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]>
1 parent 7e57714 commit 1a39ae4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/xfs/xfs_reflink.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,10 @@ xfs_reflink_allocate_cow(
425425
if (!convert_now || cmap->br_state == XFS_EXT_NORM)
426426
return 0;
427427
trace_xfs_reflink_convert_cow(ip, cmap);
428-
return xfs_reflink_convert_cow_locked(ip, offset_fsb, count_fsb);
428+
error = xfs_reflink_convert_cow_locked(ip, offset_fsb, count_fsb);
429+
if (!error)
430+
cmap->br_state = XFS_EXT_NORM;
431+
return error;
429432

430433
out_trans_cancel:
431434
xfs_trans_cancel(tp);

0 commit comments

Comments
 (0)