mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
xfs: Add error handling for xfs_reflink_cancel_cow_range
commit26b63bee2f
upstream. 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. Fixes:6231848c3a
("xfs: check for cow blocks before trying to clear them") Cc: stable@vger.kernel.org # v4.17 Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Signed-off-by: Carlos Maiolino <cem@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a5e7a81e3a
commit
31c2134667
|
@ -1392,8 +1392,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) {
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue
Block a user