Kernel: Actually report nvme request status

Due to an incorrect lambda scope capture declaration, we would copy the
result status at the start of the function, before it actually got
updated with the final status. Capture it by reference instead to
ensure we report the updated result.
This commit is contained in:
Idan Horowitz 2024-02-09 17:13:59 +02:00 committed by Andreas Kling
parent 38dad2e27f
commit 263127f21a
Notes: sideshowbarker 2024-07-16 22:58:46 +09:00

View file

@ -111,7 +111,7 @@ void NVMeQueue::complete_current_request(u16 cmdid, u16 status)
auto current_request = request_pdu.request;
AsyncDeviceRequest::RequestResult req_result = AsyncDeviceRequest::Success;
ScopeGuard guard = [req_result, status, &request_pdu] {
ScopeGuard guard = [&req_result, status, &request_pdu] {
if (request_pdu.request)
request_pdu.request->complete(req_result);
if (request_pdu.end_io_handler)