mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
Kernel: Allow WorkQueue items allocation failures propagation
In most cases it's safe to abort the requested operation and go forward, however, in some places it's not clear yet how to handle these failures, therefore, we use the MUST() wrapper to force a kernel panic for now.
This commit is contained in:
parent
02566d8091
commit
1462211ccf
9 changed files with 75 additions and 19 deletions
|
@ -121,7 +121,7 @@ void BMIDEChannel::complete_current_request(AsyncDeviceRequest::RequestResult re
|
|||
// This is important so that we can safely write the buffer back,
|
||||
// which could cause page faults. Note that this may be called immediately
|
||||
// before Processor::deferred_call_queue returns!
|
||||
g_io_work->queue([this, result]() {
|
||||
auto work_item_creation_result = g_io_work->try_queue([this, result]() {
|
||||
dbgln_if(PATA_DEBUG, "BMIDEChannel::complete_current_request result: {}", (int)result);
|
||||
SpinlockLocker lock(m_request_lock);
|
||||
VERIFY(m_current_request);
|
||||
|
@ -145,6 +145,11 @@ void BMIDEChannel::complete_current_request(AsyncDeviceRequest::RequestResult re
|
|||
lock.unlock();
|
||||
current_request->complete(result);
|
||||
});
|
||||
if (work_item_creation_result.is_error()) {
|
||||
auto current_request = m_current_request;
|
||||
m_current_request.clear();
|
||||
current_request->complete(AsyncDeviceRequest::OutOfMemory);
|
||||
}
|
||||
}
|
||||
|
||||
void BMIDEChannel::ata_write_sectors(bool slave_request, u16 capabilities)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue