]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: finish dfops on every insert range shift iteration
authorChandan Babu R <chandan.babu@oracle.com>
Mon, 31 Oct 2022 04:53:52 +0000 (10:23 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 14:56:54 +0000 (23:56 +0900)
commitd307f9d761263f84400a77727efb0c0db18a1e7e
treea9fd4bbfa5c352f01befa0b985f31d376da67e8c
parent6badb30052ce85834ad7a2c6ee119e5713b5517e
xfs: finish dfops on every insert range shift iteration

From: Brian Foster <bfoster@redhat.com>

commit edc97d6e07ff0df40e4d052cca7c7cde3d12bf4a 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: 02ed3ac858a9 ("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>
fs/xfs/xfs_bmap_util.c