Kernel: Ext2 fill now return ENOTSUP on write
We used to crash the kernel
This commit is contained in:
parent
773747cf9c
commit
1e173c178d
|
@ -145,6 +145,7 @@ namespace Kernel
|
|||
virtual BAN::ErrorOr<BAN::RefPtr<Inode>> directory_find_inode(BAN::StringView) override;
|
||||
|
||||
virtual BAN::ErrorOr<size_t> read(size_t, void*, size_t) override;
|
||||
virtual BAN::ErrorOr<size_t> write(size_t, const void*, size_t) override;
|
||||
|
||||
virtual BAN::ErrorOr<void> create_file(BAN::StringView, mode_t, uid_t, gid_t) override;
|
||||
|
||||
|
|
|
@ -291,6 +291,16 @@ namespace Kernel
|
|||
return n_read;
|
||||
}
|
||||
|
||||
BAN::ErrorOr<size_t> Ext2Inode::write(size_t offset, const void* buffer, size_t count)
|
||||
{
|
||||
(void)offset;
|
||||
(void)buffer;
|
||||
(void)count;
|
||||
if (mode().ifdir())
|
||||
return BAN::Error::from_errno(EISDIR);
|
||||
return BAN::Error::from_errno(ENOTSUP);
|
||||
}
|
||||
|
||||
BAN::ErrorOr<void> Ext2Inode::directory_read_next_entries(off_t offset, DirectoryEntryList* list, size_t list_size)
|
||||
{
|
||||
if (!mode().ifdir())
|
||||
|
|
Loading…
Reference in New Issue