]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: wait for existing dio workers in ext4_alloc_file_blocks()
authorLukas Czerner <lczerner@redhat.com>
Mon, 15 Jun 2015 04:23:53 +0000 (00:23 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 28 Apr 2020 18:02:18 +0000 (19:02 +0100)
commitd903e98eff2e520517c9e379f59ba8faee2631fb
treee566e262852bfc265c52ff959d81e29896ea3e90
parent2d3ba5e1f01a52228d74a0ee9a6c56031f68168e
ext4: wait for existing dio workers in ext4_alloc_file_blocks()

commit 0d306dcf86e8f065dff42a4a934ae9d99af35ba5 upstream.

Currently existing dio workers can jump in and potentially increase
extent tree depth while we're allocating blocks in
ext4_alloc_file_blocks().  This may cause us to underestimate the
number of credits needed for the transaction because the extent tree
depth can change after our estimation.

Fix this by waiting for all the existing dio workers in the same way
as we do it in ext4_punch_hole.  We've seen errors caused by this in
xfstest generic/299, however it's really hard to reproduce.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/ext4/extents.c