diff --git a/repos/os/src/lib/sandbox/server.cc b/repos/os/src/lib/sandbox/server.cc index c8e7a36136..c557d237be 100644 --- a/repos/os/src/lib/sandbox/server.cc +++ b/repos/os/src/lib/sandbox/server.cc @@ -316,11 +316,12 @@ void Sandbox::Server::_handle_upgrade_session_request(Xml_node request, { _client_id_space.apply(id, [&] (Session_state &session) { + if (session.phase == Session_state::UPGRADE_REQUESTED) + return; + Ram_quota const ram_quota { request.attribute_value("ram_quota", 0UL) }; Cap_quota const cap_quota { request.attribute_value("cap_quota", 0UL) }; - session.phase = Session_state::UPGRADE_REQUESTED; - try { Ram_transfer::Remote_account env_ram_account(_env.pd(), _env.pd_session_cap()); Cap_transfer::Remote_account env_cap_account(_env.pd(), _env.pd_session_cap()); @@ -338,6 +339,7 @@ void Sandbox::Server::_handle_upgrade_session_request(Xml_node request, return; } + session.phase = Session_state::UPGRADE_REQUESTED; session.increase_donated_quota(ram_quota, cap_quota); session.service().initiate_request(session); session.service().wakeup();