Message ID | 20250124034510.672-1-vulab@iscas.ac.cn (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
Series | [v2] xfs: Add error handling for xfs_reflink_cancel_cow_range | expand |
On Fri, 24 Jan 2025 11:45:09 +0800, Wentao Liang wrote: > In xfs_inactive(), xfs_reflink_cancel_cow_range() is called > without error handling, risking unnoticed failures and > inconsistent behavior compared to other parts of the code. > > Fix this issue by adding an error handling for the > xfs_reflink_cancel_cow_range(), improving code robustness. > > [...] Applied to for-next, thanks! [1/1] xfs: Add error handling for xfs_reflink_cancel_cow_range commit: 26b63bee2f6e711c5a169997fd126fddcfb90848 Best regards,
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index c8ad2606f928..1ff514b6c035 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -1404,8 +1404,11 @@ xfs_inactive( goto out; /* Try to clean out the cow blocks if there are any. */ - if (xfs_inode_has_cow_data(ip)) - xfs_reflink_cancel_cow_range(ip, 0, NULLFILEOFF, true); + if (xfs_inode_has_cow_data(ip)) { + error = xfs_reflink_cancel_cow_range(ip, 0, NULLFILEOFF, true); + if (error) + goto out; + } if (VFS_I(ip)->i_nlink != 0) { /*