Skip to content

Commit fb95897

Browse files
ISCAS-Vulabcmaiolino
authored andcommitted
xfs: Propagate errors from xfs_reflink_cancel_cow_range in xfs_dax_write_iomap_end
In xfs_dax_write_iomap_end(), directly return the result of xfs_reflink_cancel_cow_range() when !written, ensuring proper error propagation and improving code robustness. Fixes: ea6c49b ("xfs: support CoW in fsdax mode") Cc: [email protected] # v6.0 Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Wentao Liang <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]>
1 parent f5f0ed8 commit fb95897

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fs/xfs/xfs_iomap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -976,10 +976,8 @@ xfs_dax_write_iomap_end(
976976
if (!xfs_is_cow_inode(ip))
977977
return 0;
978978

979-
if (!written) {
980-
xfs_reflink_cancel_cow_range(ip, pos, length, true);
981-
return 0;
982-
}
979+
if (!written)
980+
return xfs_reflink_cancel_cow_range(ip, pos, length, true);
983981

984982
return xfs_reflink_end_cow(ip, pos, written);
985983
}

0 commit comments

Comments
 (0)