diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-12-15 19:33:39 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-12-15 19:33:39 +0100 |
commit | 5292f6e78fcc06b3defd225f5ce33d13fe5022a3 (patch) | |
tree | c27092d579b642d1b3a5cacbd91ebb833da53f6f /Kernel/FileSystem/FileSystem.h | |
parent | 7fea25943d3bd049dd3ed7b6397ce564ec953d72 (diff) | |
download | serenity-5292f6e78fcc06b3defd225f5ce33d13fe5022a3.zip |
Kernel+FileManager: Disallow watch_file() in unsupported file systems
Currently only Ext2FS and TmpFS supports InodeWatchers. We now fail
with ENOTSUPP if watch_file() is called on e.g ProcFS.
This fixes an issue with FileManager chewing up all the CPU when /proc
was opened. Watchers don't keep the watched Inode open, and when they
close, the watcher FD will EOF.
Since nothing else kept /proc open in FileManager, the watchers created
for it would EOF immediately, causing a refresh over and over.
Fixes #879.
Diffstat (limited to 'Kernel/FileSystem/FileSystem.h')
-rw-r--r-- | Kernel/FileSystem/FileSystem.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Kernel/FileSystem/FileSystem.h b/Kernel/FileSystem/FileSystem.h index 33efc77318..9538c6f132 100644 --- a/Kernel/FileSystem/FileSystem.h +++ b/Kernel/FileSystem/FileSystem.h @@ -37,6 +37,7 @@ public: virtual bool initialize() = 0; virtual const char* class_name() const = 0; virtual InodeIdentifier root_inode() const = 0; + virtual bool supports_watchers() const { return false; } bool is_readonly() const { return m_readonly; } |