mirror of
https://github.com/ceph/ceph
synced 2025-01-09 20:52:09 +00:00
librbd: hold AioCompletion lock while modifying global state
C_AioRead::finish needs to add in each chunk of a partial read
request to the 'partial' map in the AioCompletion's state
(in destriper, of type StripedReadResult). That map is global
and must be protected from simultaneous access. Use the
AioCompletion lock; could create a separate lock if contention is an
issue.
Fixes: #3567
Signed-off-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit a55700cc0a
)
This commit is contained in:
parent
b2ccf11d3a
commit
e9653f27de
@ -88,10 +88,11 @@ namespace librbd {
|
||||
if (m_req->m_ext_map.empty())
|
||||
m_req->m_ext_map[m_req->m_object_off] = m_req->data().length();
|
||||
|
||||
m_completion->destriper.add_partial_sparse_result(m_cct,
|
||||
m_req->data(),
|
||||
m_req->m_ext_map, m_req->m_object_off,
|
||||
m_req->m_buffer_extents);
|
||||
m_completion->lock.Lock();
|
||||
m_completion->destriper.add_partial_sparse_result(
|
||||
m_cct, m_req->data(), m_req->m_ext_map, m_req->m_object_off,
|
||||
m_req->m_buffer_extents);
|
||||
m_completion->lock.Unlock();
|
||||
r = m_req->m_object_len;
|
||||
}
|
||||
m_completion->complete_request(m_cct, r);
|
||||
|
Loading…
Reference in New Issue
Block a user