FAILED: patch "[PATCH] xfs: Add error handling for xfs_reflink_cancel_cow_range" failed to apply to 5.4-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y
git checkout FETCH_HEAD
git cherry-pick -x 26b63bee2f6e711c5a169997fd126fddcfb90848
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025021019-constrain-diligent-85b6@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 26b63bee2f6e711c5a169997fd126fddcfb90848 Mon Sep 17 00:00:00 2001
From: Wentao Liang <[email protected]>
Date: Fri, 24 Jan 2025 11:45:09 +0800
Subject: [PATCH] xfs: Add error handling for xfs_reflink_cancel_cow_range
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.
fs/xfs/xfs_inode.c +5 -2
@@ -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 ) {/*