Kernel: Fix disk caching when `readonly` is specified

This commit is contained in:
Bananymous 2025-01-16 16:16:38 +02:00
parent 766b8cd62e
commit 03b5c8e76e
1 changed files with 3 additions and 1 deletions

View File

@ -270,7 +270,9 @@ namespace Kernel
{
if (!m_disk_cache.has_value())
return BAN::Error::from_errno(EIO);
return m_disk_cache->write_to_cache(lba, buffer, true);
for (size_t i = 0; i < sector_count; i++)
TRY(m_disk_cache->write_to_cache(lba + i, buffer.slice(i * sector_size(), sector_size()), true));
return {};
}
if (!m_disk_cache.has_value())