Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbd67f8c authored by Sandeep Dhavale's avatar Sandeep Dhavale
Browse files

snapuserd: fix the race condition with read_ahead_buffer_map_



There are cases where concurrent access to read-ahead buffer map are
needed by readahead thread and ReadWorker thread. ReadWorker may access
the read-ahead buffer to satisfy read request for the block which is
being merged. This access was not protected by buffer_lock_.

This patch adds the necessary locking around read_ahead_buffer_map_.
As GetRABuffer() also needs MergeGroupState m_lock, we maintain the
lock order buffer_lock_ -> m_lock to avoid the lock ordering violation
and potential deadlock.

Bug: 436974300
Test: th, manual OTA on CF
Change-Id: Ie04664158d79de9f8118942f9e0da05981991181
Signed-off-by: default avatarSandeep Dhavale <dhavale@google.com>
parent 4b3ade06
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment