[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250120160907.1751-1-vulab@iscas.ac.cn>
Date: Tue, 21 Jan 2025 00:09:06 +0800
From: Wentao Liang <vulab@...as.ac.cn>
To: djwong@...nel.org
Cc: chandanbabu@...nel.org,
cem@...nel.org,
brauner@...nel.org,
dchinner@...hat.com,
yi.zhang@...wei.com,
linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
Wentao Liang <vulab@...as.ac.cn>
Subject: [PATCH] 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: ea6c49b784f0 ("xfs: support CoW in fsdax mode")
Signed-off-by: Wentao Liang <vulab@...as.ac.cn>
---
fs/xfs/xfs_iomap.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 50fa3ef89f6c..d61460309a78 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -976,10 +976,8 @@ xfs_dax_write_iomap_end(
if (!xfs_is_cow_inode(ip))
return 0;
- if (!written) {
- xfs_reflink_cancel_cow_range(ip, pos, length, true);
- return 0;
- }
+ if (!written)
+ return xfs_reflink_cancel_cow_range(ip, pos, length, true);
return xfs_reflink_end_cow(ip, pos, written);
}
--
2.42.0.windows.2
Powered by blists - more mailing lists