]> git.baikalelectronics.ru Git - kernel.git/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)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Aug 2021 11:19:06 +0000 (13:19 +0200)
commitc91d885da3ee281e6a699e1c368d0958c6a6862f
treeeab527e5a88a7b15bd0e5b720e4aa70c61db5f51
parentfe113c469467e99296561a38b5d3c9576c527b90
btrfs: wake up async_delalloc_pages waiters after submit

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>
fs/btrfs/inode.c