]> git.itanic.dy.fi Git - linux-stable/commit
btrfs: wake up async_delalloc_pages waiters after submit
authorJosef Bacik <josef@toxicpanda.com>
Wed, 14 Jul 2021 18:47:17 +0000 (14:47 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 10:26:19 +0000 (12:26 +0200)
commit8554095328ac6b00aaa02e5d95fb475d5fbb2694
treeabc4d1b5e1a7f5c7222257f22ef52468895804ca
parentd609c63a7165fa6aab0a87f173025652d731e7c9
btrfs: wake up async_delalloc_pages waiters after submit

commit ac98141d140444fe93e26471d3074c603b70e2ca upstream.

We use the async_delalloc_pages mechanism to make sure that we've
completed our async work before trying to continue our delalloc
flushing.  The reason for this is we need to see any ordered extents
that were created by our delalloc flushing.  However we're waking up
before we do the submit work, which is before we create the ordered
extents.  This is a pretty wide race window where we could potentially
think there are no ordered extents and thus exit shrink_delalloc
prematurely.  Fix this by waking us up after we've done the work to
create ordered extents.

CC: stable@vger.kernel.org # 5.4+
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/inode.c