]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix EMetaBlob dir_layout lifecycle
authorSage Weil <sage@newdream.net>
Tue, 5 Oct 2010 18:53:32 +0000 (11:53 -0700)
committerSage Weil <sage@newdream.net>
Tue, 5 Oct 2010 18:54:25 +0000 (11:54 -0700)
Initialize, delete pointer.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/events/EMetaBlob.h

index 13c4a1bba9d75ff99daa5e743d3394f70d011b88..bd5ad3bf291a6684bb4a70cfa88906df12b02be7 100644 (file)
@@ -76,7 +76,7 @@ public:
            bufferlist &sbl, bool dr, default_file_layout *defl = NULL) :
       //dn(d), dnfirst(df), dnlast(dl), dnv(v), 
       //inode(i), dirfragtree(dft), xattrs(xa), symlink(sym), snapbl(sbl), dirty(dr) 
-      _enc(1024)
+      dir_layout(NULL), _enc(1024)
     {
       ::encode(d, _enc);
       ::encode(df, _enc);
@@ -95,8 +95,11 @@ public:
       }
       ::encode(dr, _enc);      
     }
-    fullbit(bufferlist::iterator &p) { decode(p); }
-    fullbit() {}
+    fullbit(bufferlist::iterator &p) : dir_layout(NULL) { decode(p); }
+    fullbit() : dir_layout(NULL) {}
+    ~fullbit() {
+      delete dir_layout;
+    }
 
     void encode(bufferlist& bl) const {
       __u8 struct_v = 2;
@@ -137,6 +140,7 @@ public:
        in->dirfragtree = dirfragtree;
        delete in->default_layout;
        in->default_layout = dir_layout;
+       dir_layout = NULL;
        /*
         * we can do this before linking hte inode bc the split_at would
         * be a no-op.. we have no children (namely open snaprealms) to