diff options
| author | Wentao Liang <vulab@iscas.ac.cn> | 2025-01-24 11:22:28 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-02-17 11:36:42 +0100 |
| commit | d9aa19c481b0c0804dbf389a5b0b5194f3cddfb2 (patch) | |
| tree | ddad59d02fae20db9bb120bb13d19737ecd01b95 /fs | |
| parent | c601ae6670f175c918a30d05aa7391c59e69395d (diff) | |
| download | linux-d9aa19c481b0c0804dbf389a5b0b5194f3cddfb2.tar.gz linux-d9aa19c481b0c0804dbf389a5b0b5194f3cddfb2.tar.bz2 linux-d9aa19c481b0c0804dbf389a5b0b5194f3cddfb2.zip | |
xfs: Propagate errors from xfs_reflink_cancel_cow_range in xfs_dax_write_iomap_end
commit fb95897b8c60653805aa09daec575ca30983f768 upstream.
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")
Cc: stable@vger.kernel.org # v6.0
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>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/xfs/xfs_iomap.c | 6 |
1 files 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); } |
