btrfs: make sure we create all new block groups
authorJosef Bacik <josef@toxicpanda.com>
Fri, 28 Sep 2018 11:18:02 +0000 (07:18 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 15 Oct 2018 15:23:39 +0000 (17:23 +0200)
commit545e3366db823dc3342ca9d7fea803f829c9062f
treee3683a0c4c50fd3c7c760bf0692a29ea080c769f
parent553cceb49681d60975d00892877d4c871bf220f9
btrfs: make sure we create all new block groups

Allocating new chunks modifies both the extent and chunk tree, which can
trigger new chunk allocations.  So instead of doing list_for_each_safe,
just do while (!list_empty()) so we make sure we don't exit with other
pending bg's still on our list.

CC: stable@vger.kernel.org # 4.4+
Reviewed-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Liu Bo <bo.liu@linux.alibaba.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c