[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220217095542.68085-1-hsiangkao@linux.alibaba.com>
Date: Thu, 17 Feb 2022 17:55:42 +0800
From: Gao Xiang <hsiangkao@...ux.alibaba.com>
To: xfs <linux-xfs@...r.kernel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Gao Xiang <hsiangkao@...ux.alibaba.com>
Subject: [PATCH] xfs: add missing cmap->br_state = XFS_EXT_NORM update
COW extents are already converted into written real extents after
xfs_reflink_convert_cow_locked(), therefore cmap->br_state should
reflect it.
Otherwise, there is another necessary unwritten convertion
triggered in xfs_dio_write_end_io() for direct I/O cases.
Signed-off-by: Gao Xiang <hsiangkao@...ux.alibaba.com>
---
>From the logic itself and runtime tracing, IMO, it seems true.
Kindly correct me here if my understanding is wrong.
fs/xfs/xfs_reflink.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index 75bd2e03cd5b..5f0a364739a5 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -424,7 +424,10 @@ xfs_reflink_allocate_cow(
if (!convert_now || cmap->br_state == XFS_EXT_NORM)
return 0;
trace_xfs_reflink_convert_cow(ip, cmap);
- return xfs_reflink_convert_cow_locked(ip, offset_fsb, count_fsb);
+ error = xfs_reflink_convert_cow_locked(ip, offset_fsb, count_fsb);
+ if (!error)
+ cmap->br_state = XFS_EXT_NORM;
+ return error;
out_trans_cancel:
xfs_trans_cancel(tp);
--
2.24.4
Powered by blists - more mailing lists