]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix use-after-free in handle_notify_timeout
authorSage Weil <sage@inktank.com>
Fri, 24 Aug 2012 18:16:01 +0000 (11:16 -0700)
committerSage Weil <sage@inktank.com>
Fri, 24 Aug 2012 20:38:05 +0000 (13:38 -0700)
Valgrind turned this up.

Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/OSD.cc

index e2e45351850c9b7711e7189efc7921da899728ac..4c27d18fa8755f8c41ea44d4d464ee7ef17f9554 100644 (file)
@@ -2267,10 +2267,12 @@ void OSD::handle_notify_timeout(void *_notif)
 
   ReplicatedPG::ObjectContext *obc = (ReplicatedPG::ObjectContext *)notif->obc;
 
+  pg_t pgid = notif->pgid;
+
   complete_notify(_notif, obc);
   service.watch_lock.Unlock(); /* drop lock to change locking order */
 
-  put_object_context(obc, notif->pgid);
+  put_object_context(obc, pgid);
   service.watch_lock.Lock();
   /* exiting with watch_lock held */
 }