]> git.hungrycats.org Git - linux/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)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sun, 5 Dec 2021 08:11:11 +0000 (03:11 -0500)
commitd48fca16a0912b8c3143d10f43a0e29fe26985b7
tree6dd4cb2c1fe9161296fe975737886f1c42e1e709
parent2f0c21e64c81a6ae8f4b5f8a678ddaed24960db7
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>
(cherry picked from commit 0901af53da8f4cfee3bb364a35f66d0d4a9b93ba)
(cherry picked from commit 044785b485a3367309b6ac8f9c9ec720ad3755f6)
fs/btrfs/inode.c