From: "Theodore Ts'o" <tytso@mit.edu>
To: linux-xfs@vger.kernel.org
Cc: amir73il@gmail.com, djwong@kernel.org, chandan.babu@oracle.com,
leah.rumancik@gmail.com, Gao Xiang <hsiangkao@linux.alibaba.com>
Subject: [PATCH CANDIDATE v5.15 3/9] xfs: add missing cmap->br_state = XFS_EXT_NORM update
Date: Fri, 4 Aug 2023 13:10:13 -0400 [thread overview]
Message-ID: <20230804171019.1392900-3-tytso@mit.edu> (raw)
In-Reply-To: <20230804171019.1392900-1-tytso@mit.edu>
From: Gao Xiang <hsiangkao@linux.alibaba.com>
commit 1a39ae415c1be1e46f5b3f97d438c7c4adc22b63 upstream.
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@linux.alibaba.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
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 36832e4bc803..628ce65d02bb 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -425,7 +425,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.31.0
next prev parent reply other threads:[~2023-08-04 17:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230802205747.GE358316@mit.edu>
2023-08-04 17:10 ` [PATCH CANDIDATE v5.15 1/9] xfs: hoist refcount record merge predicates Theodore Ts'o
2023-08-04 17:10 ` [PATCH CANDIDATE v5.15 2/9] xfs: estimate post-merge refcounts correctly Theodore Ts'o
2023-08-04 17:10 ` Theodore Ts'o [this message]
2023-08-04 17:10 ` [PATCH CANDIDATE v5.15 4/9] xfs: Fix false ENOSPC when performing direct write on a delalloc extent in cow fork Theodore Ts'o
2023-08-04 17:10 ` [PATCH CANDIDATE v5.15 5/9] xfs: stabilize the dirent name transformation function used for ascii-ci dir hash computation Theodore Ts'o
2023-08-04 17:10 ` [PATCH CANDIDATE v5.15 6/9] xfs: use the directory name hash function for dir scrubbing Theodore Ts'o
2023-08-04 17:10 ` [PATCH CANDIDATE v5.15 7/9] xfs: get root inode correctly at bulkstat Theodore Ts'o
2023-08-04 17:10 ` [PATCH CANDIDATE v5.15 8/9] xfs: bound maximum wait time for inodegc work Theodore Ts'o
2023-08-04 17:10 ` [PATCH CANDIDATE v5.15 9/9] xfs: introduce xfs_inodegc_push() Theodore Ts'o
2023-08-04 18:09 ` Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230804171019.1392900-3-tytso@mit.edu \
--to=tytso@mit.edu \
--cc=amir73il@gmail.com \
--cc=chandan.babu@oracle.com \
--cc=djwong@kernel.org \
--cc=hsiangkao@linux.alibaba.com \
--cc=leah.rumancik@gmail.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox