1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 10:37:45 +00:00

Kernel: Switch to SpinlockProtected to protect NVMeQueue's requests map

This helps ensure no one accidentally accesses m_requests without first
locking it's spinlock. In fact this change fixed such a case, since
process_cq() implicitly assumed the caller locked the lock, which was
not the case for NVMePollQueue::submit_sqe().
This commit is contained in:
Idan Horowitz 2024-02-09 17:23:37 +02:00 committed by Andreas Kling
parent 263127f21a
commit 45aee20ea9
3 changed files with 61 additions and 60 deletions

View file

@ -113,9 +113,8 @@ private:
protected:
Spinlock<LockRank::Interrupts> m_cq_lock {};
HashMap<u16, NVMeIO> m_requests;
SpinlockProtected<HashMap<u16, NVMeIO>, LockRank::None> m_requests;
NonnullOwnPtr<Memory::Region> m_rw_dma_region;
RecursiveSpinlock<LockRank::None> m_request_lock {};
private:
u16 m_qid {};