Commit 9c516e0e authored by Brian Foster's avatar Brian Foster Committed by Darrick J. Wong

xfs: finish dfops on every insert range shift iteration

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: dd87f87d ("xfs: rework insert range into an atomic operation")
Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 9123e3a7
...@@ -1165,7 +1165,7 @@ xfs_insert_file_space( ...@@ -1165,7 +1165,7 @@ xfs_insert_file_space(
goto out_trans_cancel; goto out_trans_cancel;
do { do {
error = xfs_trans_roll_inode(&tp, ip); error = xfs_defer_finish(&tp);
if (error) if (error)
goto out_trans_cancel; goto out_trans_cancel;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment