From 5652af33849035877de961bcb4ff6f59353eb21e Mon Sep 17 00:00:00 2001 From: Bananymous Date: Fri, 28 Jul 2023 18:09:35 +0300 Subject: [PATCH] Kernel: Mark reading section from StorageDevice as terminate critical --- kernel/kernel/Storage/StorageDevice.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/kernel/Storage/StorageDevice.cpp b/kernel/kernel/Storage/StorageDevice.cpp index a8759ea8..bb3695d7 100644 --- a/kernel/kernel/Storage/StorageDevice.cpp +++ b/kernel/kernel/Storage/StorageDevice.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include @@ -263,6 +264,7 @@ namespace Kernel { for (uint8_t offset = 0; offset < sector_count; offset++) { + Thread::TerminateBlocker _(Thread::current()); uint8_t* buffer_ptr = buffer + offset * sector_size(); if (m_disk_cache.has_value()) if (m_disk_cache->read_from_cache(lba + offset, buffer_ptr)) @@ -280,6 +282,7 @@ namespace Kernel // TODO: use disk cache for dirty pages. I don't wanna think about how to do it safely now for (uint8_t sector = 0; sector < sector_count; sector++) { + Thread::TerminateBlocker _(Thread::current()); TRY(write_sectors_impl(lba + sector, 1, buffer)); if (m_disk_cache.has_value()) (void)m_disk_cache->write_to_cache(lba + sector, buffer + sector * sector_size(), false);