flexnbd: Move building the allocation map to before server socket bind()
Building the allocation map takes time, which scales with the size of the disc being presented. By building that map in the space between bind() and accept(), we leave the process in a useless state after the only good signal we have for "we are ready" and the state where it is actually ready. This was breaking migrations of large files.
This commit is contained in:
@@ -816,8 +816,8 @@ int do_serve(struct server* params)
|
||||
int has_control;
|
||||
|
||||
error_set_handler((cleanup_handler*) serve_cleanup, params);
|
||||
serve_open_server_socket(params);
|
||||
serve_init_allocation_map(params);
|
||||
serve_open_server_socket(params);
|
||||
serve_accept_loop(params);
|
||||
has_control = params->has_control;
|
||||
serve_cleanup(params, 0);
|
||||
|
Reference in New Issue
Block a user