mirror of
https://github.com/ceph/ceph
synced 2024-12-28 22:43:29 +00:00
osd: fix watch timer, locking
This commit is contained in:
parent
e31f0a4783
commit
060fd42810
@ -459,6 +459,7 @@ int OSD::init()
|
||||
Mutex::Locker lock(osd_lock);
|
||||
|
||||
timer.init();
|
||||
watch_timer.init();
|
||||
watch = new Watch();
|
||||
|
||||
// mount.
|
||||
@ -654,6 +655,10 @@ int OSD::shutdown()
|
||||
|
||||
timer.shutdown();
|
||||
|
||||
watch_lock.Lock();
|
||||
watch_timer.shutdown();
|
||||
watch_lock.Unlock();
|
||||
|
||||
heartbeat_lock.Lock();
|
||||
heartbeat_stop = true;
|
||||
heartbeat_cond.Signal();
|
||||
@ -1757,7 +1762,8 @@ void OSD::handle_notify_timeout(void *_notif)
|
||||
ReplicatedPG *pg = (ReplicatedPG *)lookup_lock_raw_pg(notif->pgid);
|
||||
pg_t pgid = notif->pgid;
|
||||
pg->do_complete_notify(notif, obc);
|
||||
put_object_context(obc, notif->pgid);
|
||||
pg->put_object_context(obc);
|
||||
pg->unlock();
|
||||
|
||||
watch_lock.Lock();
|
||||
/* exiting with watch_lock held */
|
||||
|
@ -1222,6 +1222,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops,
|
||||
|
||||
Watch::Notification *notif = osd->watch->get_notif(op.watch.cookie);
|
||||
if (!notif) {
|
||||
osd->watch_lock.Unlock();
|
||||
result = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user