mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-29 14:14:45 +03:00
Kernel/Storage: Properly free unused NVMeIO AsyncBlockDeviceRequest
This was the root cause of zombie processes showing up randomly and disappearing after some disk activity, such as running shell commands - The NVMeIO AsyncBlockDeviceRequest member simply held a pointer to a Process object, therefore it could keep it alive a for a long time after it ceased to actually function at all.
This commit is contained in:
parent
65854c3411
commit
0b6424d883
Notes:
sideshowbarker
2024-07-17 06:35:23 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/0b6424d883 Pull-request: https://github.com/SerenityOS/serenity/pull/20637 Reviewed-by: https://github.com/Panky-codes Reviewed-by: https://github.com/gmta ✅
@ -57,7 +57,7 @@ void NVMeInterruptQueue::complete_current_request(u16 cmdid, u16 status)
|
||||
request_pdu.request->complete(req_result);
|
||||
if (request_pdu.end_io_handler)
|
||||
request_pdu.end_io_handler(status);
|
||||
request_pdu.used = false;
|
||||
request_pdu.clear();
|
||||
};
|
||||
|
||||
// There can be submission without any request associated with it such as with
|
||||
@ -87,7 +87,7 @@ void NVMeInterruptQueue::complete_current_request(u16 cmdid, u16 status)
|
||||
current_request->complete(AsyncDeviceRequest::OutOfMemory);
|
||||
if (request_pdu.end_io_handler)
|
||||
request_pdu.end_io_handler(status);
|
||||
request_pdu.used = false;
|
||||
request_pdu.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ void NVMePollQueue::complete_current_request(u16 cmdid, u16 status)
|
||||
request_pdu.request->complete(req_result);
|
||||
if (request_pdu.end_io_handler)
|
||||
request_pdu.end_io_handler(status);
|
||||
request_pdu.used = false;
|
||||
request_pdu.clear();
|
||||
};
|
||||
|
||||
// There can be submission without any request associated with it such as with
|
||||
|
@ -34,6 +34,12 @@ enum class QueueType {
|
||||
class AsyncBlockDeviceRequest;
|
||||
|
||||
struct NVMeIO {
|
||||
void clear()
|
||||
{
|
||||
used = false;
|
||||
request = nullptr;
|
||||
end_io_handler = nullptr;
|
||||
}
|
||||
RefPtr<AsyncBlockDeviceRequest> request;
|
||||
bool used = false;
|
||||
Function<void(u16 status)> end_io_handler;
|
||||
|
Loading…
Reference in New Issue
Block a user