]> 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)
commit72b72a585f32db33c1ad07810b2eae8bf97e1aba
treea9fd4bbfa5c352f01befa0b985f31d376da67e8c
parent41763337b2caed21238c1575bf5f7d4fc351598c
xfs: finish dfops on every insert range shift iteration

From: Brian Foster <bfoster@redhat.com>

commit 1dfa5f4403e5141142cc87263543e5c8a706a82b 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: ee7a569a3724 ("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