ublksrv: fix disk size setup during starting device
ublksrv_open_shm() depends on valid info->ubdsrv_pid which is only
done inside ublksrv_ctrl_start_device(), so get_dev_blocks() has no
way to run ublksrv_open_shm() successfully.
Add 'daemon_pid' parameter to ublksrv_open_shm() for fixing the issue.
Meantime make sure that ublksrv_init_dev() is called before creating PID
file, so that get_dev_blocks() can observe disk size reliably.
Fixes: 3cdfe83 ("ublksrv: add 'dev_blocks' parameter to ublksrv_ctrl_start_dev")
Signed-off-by: Ming Lei <[email protected]>
3 files changed