bcachefs: Create allocator threads when allocating filesystem
authorKent Overstreet <kent.overstreet@gmail.com>
Fri, 5 Mar 2021 23:00:55 +0000 (18:00 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:53 +0000 (17:08 -0400)
commit59a7405161425df39d33faabf9f97c101fcb75d9
treeec21bf092375e2c5d62f40b010da510c95ca64d8
parent18a7b97239b6f0bae3fa1475cb276a273e07597a
bcachefs: Create allocator threads when allocating filesystem

We're seeing failures to mount because of a failure to start the
allocator threads, which currently happens fairly late in the mount
process, after walking all metadata, and kthread_create() fails if
something has tried to kill the mount process, which is probably not
what we want.

This patch avoids this issue by creating, but not starting, the
allocator threads when we preallocate all of our other in memory data
structures.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_background.c
fs/bcachefs/super.c