vfs fs: ignore dead handle IDs on handle_ack

When a directory gets destructed it dissolves the handles of each contained file
but the acknowledgement might be still in-flight. If we finally receive it,
it leads to an Unknown_id exception on the Handles ID Space in 'handle_ack'.
Now we catch it, print a warning, and go on.
This commit is contained in:
Martin Stein 2017-02-14 12:54:48 +01:00 committed by Norman Feske
parent 19868de69a
commit 0b5db07948

View File

@ -244,26 +244,29 @@ class Vfs::Fs_file_system : public File_system
Handle_space::Id const id(packet.handle());
_handle_space.apply<Fs_vfs_handle>(id, [&] (Fs_vfs_handle &handle)
{
switch (packet.operation()) {
case Packet_descriptor::READ_READY:
handle.read_ready_state = Handle_state::Read_ready_state::READY;
break;
try {
_handle_space.apply<Fs_vfs_handle>(id, [&] (Fs_vfs_handle &handle)
{
switch (packet.operation()) {
case Packet_descriptor::READ_READY:
handle.read_ready_state = Handle_state::Read_ready_state::READY;
break;
case Packet_descriptor::READ:
handle.queued_read_packet = packet;
handle.queued_read_state = Handle_state::Queued_state::ACK;
break;
case Packet_descriptor::READ:
handle.queued_read_packet = packet;
handle.queued_read_state = Handle_state::Queued_state::ACK;
break;
case Packet_descriptor::WRITE:
handle.queued_write_packet = packet;
handle.queued_write_state = Handle_state::Queued_state::ACK;
break;
}
case Packet_descriptor::WRITE:
handle.queued_write_packet = packet;
handle.queued_write_state = Handle_state::Queued_state::ACK;
break;
}
_post_signal_hook.arm(handle.context);
});
_post_signal_hook.arm(handle.context);
});
} catch (Handle_space::Unknown_id) {
Genode::warning("ack for unknown VFS handle"); }
}
}