summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandan Babu R <chandan.babu@oracle.com>2022-10-31 10:23:52 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-03 23:56:54 +0900
commit03b449a880d15b7b82215871ea6f06904d404f3e (patch)
treea9fd4bbfa5c352f01befa0b985f31d376da67e8c
parent3d295076ba4e6f57c767788748450ad3c407322e (diff)
downloadlinux-03b449a880d15b7b82215871ea6f06904d404f3e.tar.gz
linux-03b449a880d15b7b82215871ea6f06904d404f3e.tar.bz2
linux-03b449a880d15b7b82215871ea6f06904d404f3e.zip
xfs: finish dfops on every insert range shift iteration
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> Acked-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Chandan Babu R <chandan.babu@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/xfs/xfs_bmap_util.c2
1 files changed, 1 insertions, 1 deletions
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;