diff options
author | Sage Weil <sage.weil@dreamhost.com> | 2011-11-21 11:15:38 -0800 |
---|---|---|
committer | Sage Weil <sage.weil@dreamhost.com> | 2011-11-21 11:15:38 -0800 |
commit | 70dfe8e9a075cb003f9c9e07bc295c3c5b3e1288 (patch) | |
tree | c1626079ba30c0e1dbe5709f03506fa3236dfd94 | |
parent | 88963a181adb8fadb3df5a4a6c8d9d7fd56ad972 (diff) | |
download | ceph-70dfe8e9a075cb003f9c9e07bc295c3c5b3e1288.tar.gz |
osd: lock pg when requeuing requests
The op queue is shut down, so this is mostly safe, unless someone comes
through and does requeue_ops() from a callback or something.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
-rw-r--r-- | src/osd/OSD.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 791f5763961..492f7881626 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -3175,17 +3175,18 @@ void OSD::handle_osd_map(MOSDMap *m) list<Message*> rq; while (!op_queue.empty()) { PG *pg = op_queue.back(); + pg->lock(); op_queue.pop_back(); pending_ops--; - logger->set(l_osd_opq, pending_ops); - Message *mess = pg->op_queue.back(); pg->op_queue.pop_back(); + pg->unlock(); pg->put(); dout(15) << " will requeue " << *mess << dendl; rq.push_front(mess); } assert(pending_ops == 0); // we paused the wq, and just emptied out the queue + logger->set(l_osd_opq, pending_ops); push_waiters(rq); // requeue under osd_lock! op_wq.unlock(); |