From d095945d6c188e37c7a2be8c0785e6c54b3ec8ed Mon Sep 17 00:00:00 2001 From: Roman Iten Date: Sat, 19 Sep 2020 20:33:05 +0200 Subject: [PATCH] fs_rom: clear dataspace if lookup failed Issue #3897 --- repos/os/src/server/fs_rom/main.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/repos/os/src/server/fs_rom/main.cc b/repos/os/src/server/fs_rom/main.cc index 478b07fdc7..1389600ea8 100644 --- a/repos/os/src/server/fs_rom/main.cc +++ b/repos/os/src/server/fs_rom/main.cc @@ -304,7 +304,13 @@ class Fs_rom::Rom_session_component : public Rpc_object catch (Watch_failed) { } try { return _read_dataspace(update_only); } - catch (Lookup_failed) { /* missing but may appear anytime soon */ } + catch (Lookup_failed) { + if (_file_size > 0) { + _file_ds.clear(); + _file_size = 0; + Signal_transmitter(_sigh).submit(); + } + } catch (Invalid_handle) { warning(_file_path, ": invalid handle"); } catch (Invalid_name) { warning(_file_path, ": invalid name"); } catch (Permission_denied) { warning(_file_path, ": permission denied"); }