mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
Kernel/SysFS: Ensure data stability when reading from Inodes
Like with the ProcFS, description data can change at anytime, so it's wise to ensure that when the userland reads from an Inode, data is consistent unless the userland indicated it wants to refresh the data (by seeking to offset 0, or re-attaching the Inode). Otherwise, if the data changes in the middle of the reading, it can cause silent corruption in output which can lead to random crashes.
This commit is contained in:
parent
a595345e7c
commit
e490c17bde
5 changed files with 79 additions and 7 deletions
|
@ -96,6 +96,9 @@ protected:
|
|||
virtual KResult chown(UserID, GroupID) override;
|
||||
virtual KResult truncate(u64) override;
|
||||
|
||||
virtual KResult attach(FileDescription& description) override final;
|
||||
virtual void did_seek(FileDescription&, off_t) override final;
|
||||
|
||||
NonnullRefPtr<SysFSComponent> m_associated_component;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue