]> git.hungrycats.org Git - linux/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:08:58 +0000 (11:08 -0800)
commit1d6d4a0339675b0f2edb421191dc6518d5720be2
treeefc0083b840e1c6d9ca2124a9da4b754d3f5f28f
parent9aabbb2ecd0511872af94533c609f83c6104b0a6
btrfs: make sure we create all new block groups

commit 545e3366db823dc3342ca9d7fea803f829c9062f upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/extent-tree.c