]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: initialize class_handler of OSD properly 10548/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 2 Aug 2016 07:02:49 +0000 (15:02 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 2 Aug 2016 22:21:08 +0000 (06:21 +0800)
The destructor of OSD will delete class_handler arbitrarily
and there are cases we'll fail to start an osd before we
load the class_handler correctly.

So it is safe to initialize class_handler to NULL as to
avoid access violation.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/OSD.h

index 325c845e34adf99a95a09fa5900b7568f11f1088..65c4b3555af55e3e0357e6c0815254c31984f068 100644 (file)
@@ -1234,7 +1234,7 @@ protected:
   bool asok_command(string command, cmdmap_t& cmdmap, string format, ostream& ss);
 
 public:
-  ClassHandler  *class_handler;
+  ClassHandler  *class_handler = nullptr;
   int get_nodeid() { return whoami; }
   
   static ghobject_t get_osdmap_pobject_name(epoch_t epoch) {