From e2559a822b72704fcd6e85bb076ae894495daaee Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Tue, 29 May 2018 11:39:33 +0200 Subject: [PATCH] server/fs_report: don't truncate file initially fs_report truncated the report file on construction of the report session to mimic an "empty report". This prevented existing use cases where the initial state was already written to the file system by other means. I doubt that use cases exist where the inital empty-report mimic is needed and (if I'm wrong) there is still the race of the consumer reading the file just before the report session is constructed. Reporters that want to enforce an empty initial report should send it explicitly. --- repos/os/src/server/fs_report/main.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/repos/os/src/server/fs_report/main.cc b/repos/os/src/server/fs_report/main.cc index abdff82b3..f10680ae2 100644 --- a/repos/os/src/server/fs_report/main.cc +++ b/repos/os/src/server/fs_report/main.cc @@ -135,10 +135,6 @@ class Fs_report::Session_component : public Genode::Rpc_object _path(path_from_label(label.string())) { create_parent_dir(_vfs, _path, _alloc); - - try { - _file_op([&] (Vfs_handle *handle) { handle->fs().ftruncate(handle, 0); }); - } catch (...) { throw Service_denied(); } } ~Session_component() { }