From: Chandan Babu R <chandan.babu@oracle.com>
To: djwong@kernel.org
Cc: chandan.babu@oracle.com, linux-xfs@vger.kernel.org,
amir73il@gmail.com, leah.rumancik@gmail.com
Subject: [PATCH 5.4 CANDIDATE 1/3] xfs: finish dfops on every insert range shift iteration
Date: Sat, 29 Oct 2022 19:27:30 +0530 [thread overview]
Message-ID: <20221029135732.574729-2-chandan.babu@oracle.com> (raw)
In-Reply-To: <20221029135732.574729-1-chandan.babu@oracle.com>
From: Brian Foster <bfoster@redhat.com>
commit 9c516e0e4554e8f26ab73d46cbc789d7d8db664d upstream.
The recent change to make insert range an atomic operation used the
incorrect transaction rolling mechanism. The explicit transaction
roll does not finish deferred operations. This means that intents
for rmapbt updates caused by extent shifts are not logged until the
final transaction commits. Thus if a crash occurs during an insert
range, log recovery might leave the rmapbt in an inconsistent state.
This was discovered by repeated runs of generic/455.
Update insert range to finish dfops on every shift iteration. This
is similar to collapse range and ensures that intents are logged
with the transactions that make associated changes.
Fixes: dd87f87d87fa ("xfs: rework insert range into an atomic operation")
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
---
fs/xfs/xfs_bmap_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 5b211cb8b579..12c12c2ef241 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -1340,7 +1340,7 @@ xfs_insert_file_space(
goto out_trans_cancel;
do {
- error = xfs_trans_roll_inode(&tp, ip);
+ error = xfs_defer_finish(&tp);
if (error)
goto out_trans_cancel;
--
2.35.1
next prev parent reply other threads:[~2022-10-29 13:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-29 13:57 [PATCH 5.4 CANDIDATE 0/3] Fixes for patches backported to 5.4.y from v5.7 Chandan Babu R
2022-10-29 13:57 ` Chandan Babu R [this message]
2022-10-29 13:57 ` [PATCH 5.4 CANDIDATE 2/3] xfs: clear XFS_DQ_FREEING if we can't lock the dquot buffer to flush Chandan Babu R
2022-10-29 13:57 ` [PATCH 5.4 CANDIDATE 3/3] xfs: force the log after remapping a synchronous-writes file Chandan Babu R
2022-10-30 23:43 ` [PATCH 5.4 CANDIDATE 0/3] Fixes for patches backported to 5.4.y from v5.7 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=20221029135732.574729-2-chandan.babu@oracle.com \
--to=chandan.babu@oracle.com \
--cc=amir73il@gmail.com \
--cc=djwong@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.