Skip to content

Commit 9c516e0

Browse files
Brian Fosterdjwong
authored andcommitted
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: dd87f87 ("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>
1 parent 9123e3a commit 9c516e0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/xfs/xfs_bmap_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ xfs_insert_file_space(
11651165
goto out_trans_cancel;
11661166

11671167
do {
1168-
error = xfs_trans_roll_inode(&tp, ip);
1168+
error = xfs_defer_finish(&tp);
11691169
if (error)
11701170
goto out_trans_cancel;
11711171

0 commit comments

Comments
 (0)